
whenever i'm using the setEndpoint method it gives me java Ambiguous error help me to resolve this issue here is the my code
public class MainActivity extends AppCompatActivity { private final String URL = "https://cloud.appwrite.io/v1"; Account account;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
io.appwrite.Client client = new io.appwrite.Client(this)
.setEndpoint(URL)
.setProject("6648a30b00390a48c964")
.setSelfSigned(true);
account = new Account(client);
account.create(
"unique_user_id",
"email@google.com",
"password@12",
Object.class, new Continuation<User<Object>>() {
@NonNull
@Override
public CoroutineContext getContext() {
return null;
}
@Override
public void resumeWith(@NonNull Object o) {
if (o instanceof User){
Log.d("Appwrite","User Created"+o);
}
else if (o instanceof AppwriteException){
Log.e("Appwrite","Error : "+((AppwriteException) o).getMessage());
}
}
}
);
}
}

Could you provide the logcat?

error: reference to setEndpoint is ambiguous .setEndpoint(URL) ^ both method setEndpoint(String) in Client and method setEndpoint(String) in Client match

only this showing..

I think the appwrite SDK is for kotlin and not for java?

However you can add kotlin files in your android studio project

As it can interoperate with java

ohh okiee is java sdk available ?

then what i do now ??

I think you can mix java and kotlin on android studio, but not sure

but if i'm not wrong appwrite android sdk work for both languages kotlin and java..

The code to init the SDK should look like this:
Client client = new Client(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID

It's documented here: https://appwrite.io/docs/references/cloud/client-android-java/account

but i'm facing this issue right now { reference to setEndpoint is ambiguous .setEndpoint(URL) both method setEndpoint(String) in Client and method setEndpoint(String) in Client match }

Thos doesn't looks like the example I sent you

i've done many ways including your example but still facing the same issue

What's the SDK version you're using?

Is this cloud or self-hosted?

Could you try adding the URL directly into the corresponding place?

5.1.1

yes but still facing the same issue..

Hi @Batman did you find any solution ? I am having exact same problem and i couldnt find a solution.

Hlo @Batman @metin did you find any solution? I am also having same problem.

@be4st@metin If you're still facing it, it will be better creating a new post

@Batman instead of setting the endpoint using the function, you can use the constructor of Client to set your endpoint. something like this:
this.client = new Client(context, BuildConfig.ENDPOINT_URL);
Recommended threads
- phantom relationships appear on parent c...
i have this bug were my past deleted collection apears as relationship to my parent collection. when i try to delete that relationship from parent it gives me e...
- Attributes Problem - Cloud
I am not able to see the attribute columns and their context on cloud. Can you help?
- Authorization header not working in Appw...
I have an Appwrite function that takes a custom bearer token as authentication. The function works fine locally when I test it with `appwrite run functions`, bu...
