用 AndroidStudio 打開某個工程后,編譯報錯如下
Execution failed for task ':app:processDebugMainManifest'.
> 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 @5a056318
* 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.
這個工程在其他人那里是 OK 的,那大概率是 gradle 配置的問題。文章來源:http://www.zghlxwxcb.cn/news/detail-735393.html
修改 project 的 build.gradle
,gradle 版本改成自己的。文章來源地址http://www.zghlxwxcb.cn/news/detail-735393.html
buildscript {
repositories {
google()
jcenter()
}
dependencies {
//classpath "com.android.tools.build:gradle:4.1.2"
classpath "com.android.tools.build:gradle:7.1.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
到了這里,關于AndroidStudio 編譯報錯Unable to make field private final的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!