Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static member 'null.R2.id' accessed via instance reference #1703

Open
MBalazs1234 opened this issue Jul 24, 2024 · 2 comments
Open

Static member 'null.R2.id' accessed via instance reference #1703

MBalazs1234 opened this issue Jul 24, 2024 · 2 comments

Comments

@MBalazs1234
Copy link

I changed from R to R2 but the ID underlines it with the following text:
Static member 'null.R2.id' accessed via instance reference

and when I try running the code it throws this error:

java.lang.annotation.AnnotationTypeMismatchException: Incorrectly typed data found for annotation element public abstract int butterknife.BindView.value() (Found data of type R2.id)
  	at jdk.compiler/com.sun.tools.javac.model.AnnotationProxyMaker$ValueVisitor$1AnnotationTypeMismatchExceptionProxy.generateException(AnnotationProxyMaker.java:271)
  	at java.base/sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:89)
  	

Screenshot 2024-07-24 at 19 21 54

@cwiapst
Copy link

cwiapst commented Aug 15, 2024

I had the same problem

@diederikMrAwesome
Copy link

The Android Gradle plugin upgraded with the following settings on in the gradle.properties file.

android.nonFinalResIds=false
android.nonTransitiveRClass=false

This seems to have worked for us. The longer term solution is still to move to ViewBinding however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants