Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: disabling "External build" to display error output create duplicate class errors

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 messages.

I had to do some manipulation (https://stackoverflow.com/a/16876993/327402) to enable the error output to display, and found the issue that I fixed.

Unfortunately, after this "workaround" (Why the hell have I to make such things to see my errors?), I found that there was an error message that I cannot fix:

error: duplicate class: com.mypackage.name.BuildConfig
error: duplicate class: com.mypackage.name.R

I also noticed that I am not the only one to have this issue (see the comment in the SO answer I linked above)

First time, I was able to fix it by enabling "External build" again, but that happened again, because I needed to see the error output and everything is now broken, and I cannot find what happen.

With Eclipse, the R file was easy to find, in the gen folder, but with Android Studio, there are too many files, and I am a little bit lost.

Any idea/suggestion?

like image 863
Waza_Be Avatar asked Jun 14 '13 12:06

Waza_Be


Video Answer


1 Answers

I've found a question like this that has some replies here:

Cannot resolve R.java, duplicate class

You can try this:

  • Delete the Build folder generated by Android Studio automatically

Also you can try to Rebuild project by clicking Build->Rebuild project after deleting build folder.

like image 99
Jorge Fuentes González Avatar answered Sep 19 '22 17:09

Jorge Fuentes González