Back

[SOLVED] Cannot resolve method 'setKey' in 'Client'

  • 0
  • Android
  • Users
asapsonter
6 Apr, 2023, 08:50

I am trying to register users auth and database client side Android JAVA-SDK, setKey(****) throws an error

TypeScript
 // Initialize the Appwrite SDK
    Client client = new Client();
client.setEndpoint("https://[ENDPOINT]/v1").setProject("[PROJECT_ID]").setKey("[API_KEY]");

error message Cannot resolve method 'setKey' in 'Client'

TL;DR
The user is getting an error message stating that there is no `setKey` method in the `Client` class. Another user points out that in Java, setting a key is only necessary for server-to-server communication, not client-side apps. The solution is to remove the `setKey` method from the code.
joeyouss
6 Apr, 2023, 10:52

Hi πŸ‘‹

joeyouss
6 Apr, 2023, 10:52

In Java, you dont need to set key if this is a client side app. setKey is needed only for server to server communication.

asapsonter
6 Apr, 2023, 11:01

ok. THanks.

joeyouss
6 Apr, 2023, 15:49

[SOLVED] Cannot resolve method 'setKey' in 'Client'

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more