Could not resolve all files for configuration ‘:connectivity_plus:androidJdkImage’

flutter problem

How to solve Could not resolve all files for configuration ‘:connectivity_plus:androidJdkImage’ of android studio flutter.

In latest version of android studio about all user is facing the same issue

Execution failed for task ':connectivity_plus:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':connectivity_plus: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: /Users/..../Library/Android/sdk/platforms/android-34/core-for-system-modules.jar.
         > Error while executing process /Users/..../Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/jlink with arguments {--module-path /Users/malwinder/.gradle/caches/8.10.2/transforms/057cd3d70c61a40076a3bbfe497a8e16-0d4425f6-230d-4e42-a5da-d5def5f24a35/transformed/output/temp/jmod --add-modules java.base --output /Users/..../.gradle/caches/8.10.2/transforms/057cd3d70c61a40076a3bbfe497a8e16-0d4425f6-230d-4e42-a5da-d5def5f24a35/transformed/output/jdkImage --disable-plugin system-modules}

Let’s how solve flutter connectivity_plus:androidJdkImage.

To solve this problem, you need to download the java 17 in your pc. Then setup the java in your pc. Then you need to the java path. Now open the studio and delete the 35 SDK if you download. (Flutter is not support the 35 SDK till now)

Open the terminal from android studio and command

flutter config --jdk-dir (path of java 17 here)

Let go to the android/app/build.gradle file

from

compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8
    }

to

compileOptions {
        sourceCompatibility = JavaVersion.VERSION_17
        targetCompatibility = JavaVersion.VERSION_17
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_17
    }

Get more about it from https://stackoverflow.com/questions/79053829/could-not-resolve-all-files-for-configuration-connectivity-plusandroidjdkimag/79196308#79196308

I had solved my problem using this. I am using linux.

Leave a Reply

Your email address will not be published. Required fields are marked *