Unresolved reference: R
Answered
Hi everyone,
I'm considering to buy the IntelliJ IDEA Ultimate to work mainly with Android because of the premium features. I'm testing the trial version and imported the project I work to IDEA Ultimate, however, I always get the following error:
- Unresolved reference: R
Curiously, if I build the project, it generates a valid APK. This "Unresolved reference" is only in development time. The project works perfectly on Android Studio, tho. I tried several ways of fixing it based on posts on the internet (Google, Stack Overflow, this forum, etc) but none of them worked so far. Following, my environment:
Android Studio:
- Android Studio 3.3.2
- Build #AI-182.5107.16.33.5314842, built on February 16, 2019
- JRE: 1.8.0_152-release-1248-b01 x86_64
- JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
- macOS 10.14.3
IntelliJ IDEA:
- IntelliJ IDEA 2018.3.5 (Ultimate Edition)
- Build #IU-183.5912.21, built on February 26, 2019
- JRE: 1.8.0_152-release-1343-b28 x86_64
- JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
- macOS 10.14.3
Gradle:
- Wrapper: 4.10.1-all
- Plugin: 3.3.2
Any ideas of how I can fix it?
Thank you.
Please sign in to leave a comment.
Hello Marcello,
Please try 2019.1 EAP: https://www.jetbrains.com/idea/nextversion/
Hi Yaroslav,
Everything worked well on 2019.1 EAP.
Thank you very much!
See https://twitter.com/tasomaniac/status/1103020923874131968 for the details.
Gradle Android Plugin 3.3+ no longer generates R source file. You either need to update to the IDE that supports the new binary format for the resources or downgrade the plug-in to an older version in your build.gradle.