https://kotlinlang.org logo
#android
Title
# android
r

ribesg

02/25/2019, 3:44 PM
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

Casey Brooks

02/25/2019, 3:49 PM
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

ribesg

02/25/2019, 3:52 PM
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

Casey Brooks

02/25/2019, 3:54 PM
You can also try doing File > Invalidate Caches / Restart… . Sometimes IDEA just gets confused and that might fix it
l

LeoColman

02/25/2019, 3:54 PM
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

ribesg

02/25/2019, 3:55 PM
Yes that worked, I had to manually remove
.gradle
and
build
folders, then ran
./gradlew build
and it works, thanks a lot
👍 1
l

LeoColman

02/25/2019, 4:01 PM
Do anybody know when IntelliJ will adapt to this behavior?
I really dislike using Android Studio :x
r

ribesg

02/25/2019, 4:07 PM
Usually AS updates are part of the following IDEA update and vice versa
l

louiscad

02/25/2019, 4:10 PM
I think latest IntelliJ EAP is ready for 3.3.1
l

LeoColman

02/25/2019, 4:24 PM
I don't think so. I always use the latest EAP and I'm having these issues
c

CLOVIS

02/28/2019, 5:33 PM
I had this problem lately. I created another project and it's gone.