当前位置:   article > 正文

Android studio解决Execution failed for task ‘:app:compileDebugJavaWithJavac‘.报错_execution failed for task ':app:compiledebugjavawi

execution failed for task ':app:compiledebugjavawithjavac'.

一,打包apk报错信息如下:

Execution failed for task ':app:compileDebugJavaWithJavac'.

superclass access check failed: class butterknife.compiler.ButterKnifeProcessor$RScanner (in unnamed module @0x7f7bb073) cannot access class com.sun.tools.javac.tree.TreeScanner (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.tree to unnamed module @0x7f7bb073

二、解决办法:
1. 更新gradle到7.0.2;

2. 更新compileSdk到31,编译工具也到31版本;

3. 更新所有插件,androidx指定版本,如下:

implementation "androidx.core:core-ktx:1.7.0"

4. 更新Gradle java为15

5. 编译JAVA为1.8

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

重新clean打包,ok!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/空白诗007/article/detail/735707
推荐阅读
相关标签
  

闽ICP备14008679号