I am starting my migration from Eclipse to Android Studio, and start playing with new projects on Studio.
My test project was working fine till I got some errors mes
Ok, I also have the same problem, and this is what worked for me. I first unticked external build from compiler settings. Then when I compiled i get two errors related to R.java, duplicate class. Then i delete the build folder manually from finder. Then rebuild it from android studio, but still same error. Then I again go back to compiler preference and tick the external build setting, and it worked fine after that. Looks like some bug.
apparently, or at least for me 0.1.5 has a bug and cannot run in external build because of some path error you can read about here https://code.google.com/p/android/issues/detail?id=56628
so i switched to internal building, and then i hit the double R symbol bug
after deleting the build path application is compiled without errors but the build folder is not fully rebuilt, I'm missing the R.java file which the internal builder does not make.
i've rebuilt it on the external builder on an unupdated version as a temp workaround while this issues is fixed.
btw if anyone knows how to tell internal gradle to rebuild the build folder please share.
I just had the same problem and found a way to solve it (You can do this with Android Studio open):
build
.build
folder among with libs
and src
folders and a file named build.gradle
.build
folder to build2
or something else.Build->Rebuild Project
.build2
folder that you renamed is located.build
that was created.build2
folder to build
again.Done.
So, just to let you know...
A few minutes after I posted my question, Google released an update to Android Studio (0.1.5) See link: https://plus.google.com/+AndroidDevelopers/posts/Y9vhvGaHCbh
Tor Norbye kindly answered my question in this community, and I am sharing here
So the workaround I quoted in the OP is no more mandatory.
Enabling again External build after upgrading Android Sudio let me see the real errors ( a library and some Gradle import that I fixed)
So, I consider the Android Studio upgrade as the best answer to this question...
I've found a question like this that has some replies here:
Cannot resolve R.java, duplicate class
You can try this:
Also you can try to Rebuild project by clicking Build->Rebuild project after deleting build folder.