
Because when we deploy manually via console it's not taking the package dependencies

using appwrite deploy function

What is the fourth parameter you are passing to the list documents method. What is the nested type you are providing.

@Danish Can you try the below code snippet
import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases;
Client client = new Client(context) .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2"); // Your project ID
Databases databases = new Databases(client);
databases.listDocuments( "[DATABASE_ID]", "[COLLECTION_ID]", new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); return; }
Log.d("Appwrite", result.toString());
})
);

You can add your query parameter as the third parameter and provide the callback function as last parameter

Also for setting limit for queties you can try this Query.limit(25)

It worked

Super

but got this error on build:
> Task :compileJava
Note: /usr/local/server/src/main/java/io/openruntimes/java/Server.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /usr/local/server/src/main/java/io/openruntimes/java/Server.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
> Task :processResources
> Task :classes
> Task :buildJar FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':buildJar'.
> Entry module-info.class is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/7.5.1/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details.

not able to view the result so not sure it worked perfectly or not

Did you write any custom logic for gradle

It is saying entry module is duplicate. Can you check if you have two main methods or just one method

no, just one Main.java file with one main method

wrote nothing, just the deps in deps.gradle file

Ok

Answer from StackOverflow : Looks like a cache error (with kotlin) to me. Running gradle clean or gradle clear (not sure which is the right spelling, sorry, one of these should exist as a gradle task) and rebuilding should fix the error, because all files in cache will be deleted by the task and regenerated by the project build.

It's not possible for us to run gradle clean

Can you initialise a new project and a new function and try this

sure

still the same build err

Hi @Danish were you able to solve it?

no not yet

Looks like you have another post for this problem so I'm closing this one

[SOLVED] Build Errors in template for Sync with Meilisearch in Java

Recommended threads
- How can I check which version of node-ap...
Hi everyone, I deployed a Function on Appwrite with the following in my package.json: ```"dependencies": { "node-appwrite": "*" }``` Since Appwrite automat...
- Various Issues with Selfhosted Instance
When Creating sites, applications and messages i get different errors in Appwrite: When adding Site: Cannot access offset of type string on string When buildi...
- Failed to verify JWT. Invalid token: Exp...
Hi I am trying to call a function from my mobile app, but I am receiving "Invalid token expired." My code looks more or less like this ```ts // from my app ...
