
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
- Where is tensorflow support? 3.11 ML doe...
and if i manually tried to add tensorflow i get Cannot access offset of type string on string no matter what
- OAuth2 Error: invalid success param url ...
Hi everyone! I'm trying to implement Google OAuth2 login in a React Native app (using the Android simulator) with Appwrite Cloud, and I'm getting the following ...
- Trying to set up a new appwrite project
we have used the folder structure as follow Functions /function-name /src/index,js This is our entrypoint and git confugre settings When I try to run ...
