IntelliJ doesn’t find a R.java file, Android Studi...
# android
r
IntelliJ doesn’t find a R.java file, Android Studio does but does not tell me where it is, all I can find on SO is things about a root
gen
folder, I don’t have that... Any idea why I don’t have a R file? I’ve been stuck on this for hours now. The build works, the app works, IDEA just keeps telling me R is not found and removing the imports every time I optimize imports
👍 1
c
Did you recently upgrade the Android Gradle Plugin version without upgrading Android Studio? AGP 3.3.0 changes how the R classes are generated for library projects which did the same thing to me until I upgraded to the latest AS version
r
I see, what does that mean for IDEA user? What should I do? I rollbacked to 3.2.1 but I still don’t have an R
c
You can also try doing File > Invalidate Caches / Restart… . Sometimes IDEA just gets confused and that might fix it
l
I did the same thing, rolling back to 3.2.1 and it works again
What I did was change to 3.2.1, erase any folders that wasn't in version control and forcing intellij to generate everything
r
Yes that worked, I had to manually remove
.gradle
and
build
folders, then ran
./gradlew build
and it works, thanks a lot
👍 1
l
Do anybody know when IntelliJ will adapt to this behavior?
I really dislike using Android Studio :x
r
Usually AS updates are part of the following IDEA update and vice versa
l
I think latest IntelliJ EAP is ready for 3.3.1
l
I don't think so. I always use the latest EAP and I'm having these issues
c
I had this problem lately. I created another project and it's gone.