1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Execution failed for task ':path_provider_android:compileDebugJavaWithJavac'

Discussão em 'Mobile' iniciado por Stack, Novembro 5, 2024 às 20:22.

  1. Stack

    Stack Membro Participativo

    I am having this problem with my android studio, so anytime I ran the actual default flutter project in android studio it runs. as soon as I add packages in the pubspec.yaml I get errors. I am trying to run a project, this project has been running so well for sometime now. all of a sudden when I come back to the project and run it I get this weird error. I asked ChatGPT and it said it was a jdk incompatibility problem. this is the error.


    Launching lib\main.dart on AOSP on IA Emulator 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:\Users\Mr. Wolfe\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\Mr. Wolfe\.gradle\caches\transforms-3\4a46fc89ed5f9adfe3afebf74eb8bfeb\transformed\output\temp\jmod --add-modules java.base --output C:\Users\Mr. Wolfe\.gradle\caches\transforms-3\4a46fc89ed5f9adfe3afebf74eb8bfeb\transformed\output\jdkImage --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 9s
    Error: Gradle task assembleDebug failed with exit code 1



    this is what my app/build.gradile looks like;


    plugins {
    id "com.android.application"
    id "kotlin-android"
    // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
    id "dev.flutter.flutter-gradle-plugin"
    }

    android {
    namespace = "com.example.new_flutter"
    compileSdk = flutter.compileSdkVersion
    ndkVersion = flutter.ndkVersion

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

    kotlinOptions {
    jvmTarget = JavaVersion.VERSION_1_8
    }

    defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId = "com.example.new_flutter"
    // You can update the following values to match your application needs.
    // For more information, see: https://flutter.dev/to/review-gradle-config.
    minSdk = flutter.minSdkVersion
    targetSdk = flutter.targetSdkVersion
    // multiDexEnabled true
    versionCode = flutter.versionCode
    versionName = flutter.versionName
    }

    buildTypes {
    release {
    // TODO: Add your own signing config for the release build.
    // Signing with the debug keys for now, so `flutter run --release` works.
    signingConfig = signingConfigs.debug
    }
    }
    }

    flutter {
    source = "../.."
    }

    Continue reading...

Compartilhe esta Página