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
- Need help with createExecution function
Hi, Need some help understanding createExecution. When requesting function execution via createExecution, the function handler arguments are incorrect and rese...
- HTTP POST to function returning "No Appw...
Hi everyone, I’m running into an issue with my self-hosted Appwrite instance. I’ve set up my environment variables (APPWRITE_FUNCTION_PROJECT_ID, APPWRITE_FUNC...
- Can't add dart 3.5 runtime
Modified the `.env` to enable dart 3.5 runtime on my self-hosted instance but still can't find the runtime when creating a new function. I manually pulled the i...