fluttergradleandroid-gradle-plugin

How to fix :app:processDebugMainManifest error in flutter execution


FAILURE: Build failed with an exception.

Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @79c9bfe4

BUILD FAILED in 13s

How to fix this issue


Solution

  • Update your Gradle and Android Plugin versions Open your android/build.gradle file and make sure the Gradle version and Android Gradle Plugin version are up to date.
    Example:

    buildscript {
        ext.kotlin_version = '1.8.10'
        repositories {
            google()
            mavenCentral()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:8.0.2'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        }
    }
    
    allprojects {
        repositories {
            google()
            mavenCentral()
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

    Make sure your Gradle wrapper in uses a compatible version

    android/gradle/wrapper/gradle-wrapper.properties:

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