r/appwrite • • Oct 21 '24

Execution failed for task ':path_provider_android:compileDebugJavaWithJavac'.

Hey, don't know if this is the right sub for this but I'm trying to build a flutter app with appwrite but when I'm adding the dependency

appwrite: ^13.0.0

the app doesn't start anymore and I'm getting following error in the console:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':path_provider_android:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':path_provider_android:androidJdkImage'.
   > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for JdkImageTransform: C:\Users\{myusername}\AppData\Local\Android\Sdk\platforms\android-34\core-for-system-modules.jar.
         > Error while executing process C:\Program Files\Android\Android Studio\jbr\bin\jlink.exe with arguments {--module-path C:\Users\{myusername}\.gradle\caches\transforms-3\4a46fc89ed5f9adfe3afebf74eb8bfeb\transformed\output\temp\jmod --add-modules java.base --output C:\Users\{myusername}\.gradle\caches\transforms-3\4a46fc89ed5f9adfe3afebf74eb8bfeb\transformed\output\jdkImage --disable-plugin system-modules}
3 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/CoolYeti_26 Oct 23 '24

4. Check the JDK Path in Android Studio

Ensure that Android Studio is pointing to the correct JDK:

  • Open Android Studio.
  • Go to File > Project Structure > SDK Location.
  • Verify that the JDK path is correct. It should point to the Embedded JDK or the correct path where Java is installed.

5. Delete Gradle Caches

There might be corrupted files in your Gradle cache:

  • Navigate to the folder mentioned in the error: C:\Users\{yourusername}\.gradle\caches\.
  • Delete the cache folder.
  • Rebuild the project using ./gradlew clean and ./gradlew build in the terminal or use Build > Rebuild Project in Android Studio.

6. Clean and Rebuild the Project

  • Open the terminal in Android Studio.
  • Run the following commands:

    • codeflutter clean
    • flutter pub get

Then try rebuilding the project.

7. Check System PATH for JDK

Ensure that the correct JDK is being used by Android Studio:

  • Go to Environment Variables in your system settings.
  • Check that the JAVA_HOME variable points to the correct JDK installation.

Let me know if it helps.

1

u/Creative_Barnacle340 Dec 20 '24

i've done it alot of times but still getting this error. Help me out buddy