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
- AppwriteException: Route not found!
I am executing Appwrite Function from react, getting below error for fetching data from table in function. Code snippet where function throw this error: cons...
- Feedback and Deployment Challenges with ...
Hello world!, I've been developing a project using FastAPI in Python, and I was considering deploying it through Appwrite Functions. However, I encountered a f...
- Bulk feature status
Hi there, I am using version 1.7.4 self hosted and wanted to use the bulk operations in a dart function. I saw that in the dart_appwrite sdk version 16.1.0 it ...