butterknife
butterknife copied to clipboard
Gradle 8.0 build issue
Cause: superclass access check failed: class butterknife.compiler.ButterKnifeProcessor$RScanner (in unnamed module @0x69d73d) 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 @0x69d73d
i am also facing Same issue . Updated build version also
I have same problem in my guess gradle 8.0 need jdk17 but butterknife is not surport jdk 17
I am also facing the same issue. Not even running the project. Please fix it.
I am also facing the same issue with gradle 8.0. Can anyone please help me out ?
I am also facing issue with gradle 8.0 need jdk17
same problem but gradle 8.0 isn't the reason, 7.2.2 - still appears appeared after update on Android Studio to Flamingo
same problem but gradle 8.0 isn't the reason, 7.2.2 - still appears appeared after update on Android Studio to Flamingo
@jorrrdane I agree as well. It seems to be related to Flamingo upgrade. I just upgraded and run into this problem (Linux).
Android Studio Flamingo | 2022.2.1
Build #AI-222.4459.24.2221.9862592, built on March 31, 2023
Runtime version: 17.0.6+0-17.0.6b802.4-9586694 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.15.85-1-manjaro
GC: G1 Young Generation, G1 Old Generation
Memory: 3072M
Cores: 6
Registry:
external.system.auto.import.disabled=true
ide.text.editor.with.preview.show.floating.toolbar=false
ide.instant.shutdown=false
gradle.version.catalogs.dynamic.support=true
Non-Bundled Plugins:
idea.plugin.protoeditor (222.4459.16)
org.jetbrains.plugins.hocon (2022.1.0)
com.github.adamwojszczyk.sepiaTheme (0.7.0)
Current Desktop: MATE
When I saw errors like this in the past, eventually they were related to the proguard. But in my case, I am building debug, so proguard should not even be in the picture
I have upgraded a toy project to AGP 8.0 through a few walkarounds below
# <app/build.gradle>
# https://stackoverflow.com/questions/65380359/lomboks-access-to-jdk-compilers-internal-packages-incompatible-with-java-16
# enable internal JDK API access at runtime
tasks.withType(JavaCompile).configureEach {
options.fork = true
options.forkOptions.jvmArgs += [
# essential for butterknife
'--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED',
# if you need Glide or LomBok
# these may not be the exact list, but it works for me
'--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED',
]
}
# <gradle.properties>
# https://developer.android.com/build/releases/gradle-plugin#default-changes
# @BindView requires a constant resource ID
android.nonFinalResIds=false
I am also facing this issue. please fix it as soon as possible @JakeWharton
superclass access check failed: class butterknife.compiler.ButterKnifeProcessor$RScanner (in unnamed module @0x4ed70468) 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 @0x4ed70468
go to Android Studio Preferences..., then Build, Execution, Deployment / Build Tools / Gradle, then set the Gradle JDK to be of some version 15
I have same problem in my guess gradle 8.0 need jdk17 but butterknife is not surport jdk 17
same issue . need solution.
Apr 25, 2023
can't. when use gradle 8, JDK version 17 at least
go to Android Studio Preferences..., then Build, Execution, Deployment / Build Tools / Gradle, then set the Gradle JDK to be of some version 15
Tested and effective
Faced the same issue. With this seetings it is working for me:
gradle-wrapper.properties:
build.gradle (app):
build.gradle (project) dependencies:
JDK is 17.
go to Android Studio Preferences..., then Build, Execution, Deployment / Build Tools / Gradle, then set the Gradle JDK to be of some version 15
Fix works if your gradle version is still under 8.0 (as it requires JDK 17 minimium).
@JakeWharton If the library is discontinued in support - should we even hope for the update to support JDK 17 ?
use JDK15 can fixed.
its working thanks lot
use JDK15 can fixed. this fix is not work
The default JDK version of Android Studio Flamingo is 17 , which will cause the compilation to fail.
Solution:
- Install OpenJDK 11 or JDK 11
- Modify the default JDK version of Android Studio
Settings --> Gradle --> Gradle JDK:(set your install JDK)
use JDK15 can fixed. this fix is not work are you sure?
Use Gradle JDK 11 version from settings search gradle and select JDK version 11, Works for me
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
Use JDK Version 11.0.19 actual version but use around 11 versions. it'll work.
Hello! I used this on my build.gradle(app)
kotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
Plus this:
["I faced this issue just after updating android Studio to Android Studio Flamingo | 2022.2.1, my project was using embeded jdk, i fixed using simple steps"](https://stackoverflow.com/questions/71257962/how-can-i-fix-this-error-with-butterknife-in-android-studio)
https://www.oracle.com/pk/java/technologies/javase/jdk11-archive-downloads.html
Download JDK 11 for your desired OS
Install it
Android Studio-> File -> Project Structure -> SDK Location -> Click on Gradle Settings (blue hightlighted text) -> Select the jdk 11 with 11.0 something version name from list
Run The Project
Boom! it's works
Or migrate to viewBinding
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
go to Android Studio Preferences..., then Build, Execution, Deployment / Build Tools / Gradle, then set the Gradle JDK to be of some version 15
Yes i did the same, i changed it to jdk 11 and now my project is working fine
tasks.withType(JavaCompile).configureEach {
how to use the kotlin file, thanks
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
same problem, Please don't deprecate this lib. Although there is view binding, this lib are still better than view binding. eg.eliminating anonymous inner-classes for listeners by annotating methods with @OnClick and others.