android - IllegalAccessException : can not access a member of class com. android.build.gradle.tasks.ManifestProcessorTask

标签 android android-studio kotlin

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/

相关文章:

Kotlin 从函数中引用全局变量

java - firebase 将数据作为数组获取

android - 在 Xamarin 中更改 ImageView 上的图像

android - 运行 main.dart I/flutter (15748) : Observatory listening on ************************************ 后无法获得输出

android - 如何确定 Android 上 Google Play 服务的实际内部版本号?

android - 如何知道 strings.xml 中的字符串在哪里使用

json - @RequestBody无法与@JsonProperty一起使用

java - Android CardView 填充错误

android - ActivityManager 不保留 REAL_GET_TASKS 警告

android - 如果在其他情况下我没有什么可退还的,如何处理详尽的问题?