Search code examples
javaandroidflutterdebugginggradle

Could not resolve all files for configuration ':app:androidJdkImage


I am trying to build flutter apk on debug mode from android studio.

Flutter run I get this error:

Launching lib/main.dart on sdk gphone x86 arm in debug mode... Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.

Could not resolve all files for configuration ':app: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/mac/Library/Android/sdk/platforms/android-30/core-for-system-modules.jar. > jlink executable /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/jlink does not exist.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 20s Exception: Gradle task assembleDebug failed with exit code 1


Solution

  • I solved this issue by downloading the required NDK side by side package as shown in this screenshot for the required SDK platform.

    If you keep getting errors after doing this, please share error logs or screenshots. Thanks.

    Android Studio screenshot