flutter Execution failed for task ':device_info_plus:compileDebugJavaWithJavac'.

发布时间:2023-11-21 23:35:14

报错信息

* What went wrong:
Execution failed for task ':device_info_plus:compileDebugJavaWithJavac'.
> java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x84917f3) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x84917f3

* 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 59s
Exception: Gradle task assembleDebug failed with exit code 1

android/gradle.properties 文件内修改行 org.gradle.jvmargs

org.gradle.jvmargs=-Xmx1536M --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED


Card image cap
APP STORE
Card image cap
应用宝
Card image cap
小米
Card image cap
华为