这里写自定义目录标题
- [not "opens java.io" to unnamed module错误](#not "opens java.io" to unnamed module错误)
- [superclass access check failed: class butterknife.compiler.ButterKnifeProcessorRScanner报错](#superclass access check failed: class butterknife.compiler.ButterKnifeProcessorRScanner报错)
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后面增加配置:
javascript
--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可以编译成功