Android Studio marks R in red with error message cannot resolve symbol R , but build succeeds
Here is my temporary solution until I find a better one:
Using Everything, find where R.java is created. In my case it was
C:\Program Files (x86)\Android\android-studio\system\compiler\<project-name>.cb969c52\.generated\aapt\<module-name>.6badd9a4\production\com\<project-name>\<module-name>
In the Project view, click the module and press F4. Ignore the warning.
Click "+ Add Content Root" and select the aforementioned folder. Make sure it's marked in blue (as a source).
After I did this, suddenly all the warnings are gone. The problem is that if you collaborate with other people, the folder name is different on each machine so be careful when synchronizing.
Android Studio marks R in red with error message cannot resolve symbol R , but build succeeds
Here is my temporary solution until I find a better one:
Using Everything, find where R.java is created. In my case it was
C:\Program Files (x86)\Android\android-studio\system\compiler\<project-name>.cb969c52\.generated\aapt\<module-name>.6badd9a4\production\com\<project-name>\<module-name>
In the Project view, click the module and press F4. Ignore the warning.
Click "+ Add Content Root" and select the aforementioned folder. Make sure it's marked in blue (as a source).
After I did this, suddenly all the warnings are gone. The problem is that if you collaborate with other people, the folder name is different on each machine so be careful when synchronizing.
Android Studio marks R in red with error message cannot resolve symbol R , but build succeeds
Here is my temporary solution until I find a better one:
Using Everything, find where R.java is created. In my case it was
C:\Program Files (x86)\Android\android-studio\system\compiler\<project-name>.cb969c52\.generated\aapt\<module-name>.6badd9a4\production\com\<project-name>\<module-name>
In the Project view, click the module and press F4. Ignore the warning.
Click "+ Add Content Root" and select the aforementioned folder. Make sure it's marked in blue (as a source).
After I did this, suddenly all the warnings are gone. The problem is that if you collaborate with other people, the folder name is different on each machine so be careful when synchronizing.
Related Topics
Adding Local .Aar Files to Gradle Build Using "Flatdirs" Is Not Working
How to Inflate One View with a Layout
How to Solve Java.Lang.Outofmemoryerror Trouble in Android
Trying to Attach a File from Sd Card to Email
Custom Toast on Android: a Simple Example
How to Hang Up Outgoing Call in Android
How to Disable Gradle 'Offline Mode' in Android Studio
Telephonymanager.Getline1Number() Failing
Nested Recycler View Height Doesn't Wrap Its Content
Differencebetween Min Sdk Version/Target Sdk Version VS. Compile Sdk Version
Failed to Load Appcompat Actionbar with Unknown Error in Android Studio
Warning: This Asynctask Class Should Be Static or Leaks Might Occur
Error "The Connection to Adb Is Down, and a Severe Error Has Occurred."
How to Install Trusted Ca Certificate on Android Device
Using Both Front and Back Cameras Simultaneously Android