Android studio升级Giraffe | 2022.3.1 Patch 1踩坑

这里写自定义目录标题

  • not "opens java.io" to unnamed module错误
    • 报错信息
    • 解决
  • superclass access check failed: class butterknife.compiler.ButterKnifeProcessor$RScanner报错
    • 报错信息
    • 解决

Android studio升级Giraffe | 2022.3.1 Patch 1后,出现项目编译不过,报了一些错,记录一下。

not “opens java.io” to unnamed module错误

报错信息

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

解决

解决方案,在gradle.properties的org.gradle.jvmargs后面增加配置:

--add-exports=java.base/sun.nio.ch=ALL-UNNAMED \
--add-opens=java.base/java.lang=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 \
--add-opens java.base/java.net=ALL-UNNAMED

superclass access check failed: class butterknife.compiler.ButterKnifeProcessor$RScanner报错

报错信息

Cause: superclass access check failed: class butterknife.compiler.ButterKnifeProcessor$RScanner (in unnamed module @0x4723fba2) 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 @0x4723fba2

解决

jdk版本过高不兼容, 本地使用的是jdk17,改成jdk15可以编译成功
Android studio升级Giraffe | 2022.3.1 Patch 1踩坑_第1张图片

你可能感兴趣的:(android,studio,android,studio,android,ide)