Android Studio 一直告诉我构建失败。我没有使用 Kotlin,我所有的代码都在 JAVA 中。仅当我想构建/运行项目时,我才会不断收到此错误。我总是需要删除 .gradle 文件夹并重新启动 Android Studio 才能让它再次工作。我觉得这不是 IDE 问题,因为我同时使用了 IDE 版本 3.1 和 3.3。我还将 Kotlin 更新到了当前 1.2.70 的最新版本
* What went wrong:
A problem occurred configuring project ':app'.
> Could not create task ':app:processProdDebugManifest'.
> java.lang.IllegalAccessException: Class kotlin.reflect.jvm.internal.FunctionCaller$FieldSetter can not access a member of class com.android.build.gradle.tasks.ManifestProcessorTask with modifiers "private"
ext.kotlin_version = "1.2.70"
在完全重新启动并使缓存失效后,构建成功,但在进行任何新更改后,我无法再次构建,直到我重新启动整个 IDE 并删除 .gradle 文件夹
这是我的根项目版本号
ext {
// SDK and tools
minSDK = 18
targetSDK = 28
compileSDK = 28
buildTools = '28.0.2'
// SUPPORT LIBRARY
SupportLibrary = '28.0.0-rc02'
// Debug the App
debugMode = true
minify = true
proguard = false
multidex = false
// App Versioning
versionCode = 7
versionName = 0.7
}
最佳答案
每次出现这个问题,我都会重启/使缓存失效,问题就解决了。
文件 > 使缓存无效/重新启动... > 无效并重新启动
关于android - IllegalAccessException : can not access a member of class com. android.build.gradle.tasks.ManifestProcessorTask,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52424269/