skip to Main Content

I’m having trouble running my Flutter app on Android, and I’m encountering an error during the build process.

This is the error i am facing and i am not able to build my app

Launching libmain.dart on sdk gphone64 x86 64 in debug mode…
Running Gradle task ‘assembleDebug’…

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:UsersshahiAppDataLocalAndroidsdkplatformsandroid-34core-for-system-modules.jar.
> Error while executing process C:Program FilesAndroidAndroid Studiojbrbinjlink.exe with arguments {–module-path C:Usersshahi.gradlecachestransforms-39263d05e7a9236c2cfa2ca39c5a20e5atransformedoutputtempjmod –add-modules java.base –output C:Usersshahi.gradlecachestransforms-39263d05e7a9236c2cfa2ca39c5a20e5atransformedoutputjdkImage –disable-plugin system-modules}

  • 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 22s
Error: Gradle task assembleDebug failed with exit code 1

Yesterday,
i updated my flutter,dart and Android Studio and currently i am using Android Studio LadyBug and i am not able to build my app

I have tried reinstalling android studio,plugins and all the solutions that were previous available such as updating Android Command Line Tools from SDK Manager. I have checked all my environment variables and its all correct. The issue started as i updated my flutter,dart and android studio.

I have tried Flutter clean,flutter pub get etc.

2

Answers


  1. Update com.android.application plugin to version 8.3.2 or latest in settings.gradle file.

    If you can’t find this file you can create one at root of Android folder of Flutter project and copy paste below content:

    pluginManagement {
        def flutterSdkPath = {
            def properties = new Properties()
            file("local.properties").withInputStream { properties.load(it) }
            def flutterSdkPath = properties.getProperty("flutter.sdk")
            assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
            return flutterSdkPath
        }()
    
    includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
    
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
        }
        }
    
    plugins {
        id "dev.flutter.flutter-plugin-loader" version "1.0.0"
        id "com.android.application" version "8.3.2" apply false
        id "org.jetbrains.kotlin.android" version "2.0.21" apply false
    }
    
    include ":app"
    
    Login or Signup to reply.
  2. Change to 8.3.2 in

    Setting.gradle

    id "com.android.application" version "8.3.2" apply false
    

    Change to 8.4 or 8.5 in

    Gradlewrapper.properties

    distributionUrl=https://services.gradle.org/distributions/gradle-8.4-all.zip
    

    change Ndkversion to

    ndkVersion '25.1.8937393'
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search