
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
- Creating a relationship with nested obje...
{ "data": { "name": "DiDi", "type": "Software Development", "userJobs": [{ "$id": "68cbf1e2003612fb13ca", "j...
- Realtime integration with SSR auth
Hey, I have a nextjs website with SSR auth, works great. I use a session client for user verification and an admin client with API key. Both is used with node-...
- Adding "name" column to table creates 2-...
As stated, im adding the "name" column to one table, it adds 4 duplicates. In another table it adds 3 duplicates, and when I delete 1 of them, all duplucates di...
