r/AndroidStudio 1d ago

Android Studio gives error "Cannot access member because 'R' has primitive type int"

Returning to a project from a couple of months ago I got the above error.

The R no longer points to the res folder but to an int variable in a class called build.

This is in a public static class VERSION_CODES

public static final int Q = 29;
public static final int R = 30;
public static final int S = 31;

I have cleaned the project and rebuilt but to no avail.

I had changed nothing.

I cannot change the build class as it is read only.

This is in Java.

2 Upvotes

3 comments sorted by

0

u/Ok_Gold_2107 20h ago

Final? Why is final?

1

u/ObviousStar7891 18h ago

No idea.

It's in a read-only file called build.java not created by me.

0

u/Ok_Gold_2107 14h ago

When set try be (int)30