I\'m trying to learn android development and I am initially confused by the different project structures between Eclipse and Android Studio. This makes it difficult to follo
Android Studio: app\build\source\r\debug\com.example.app\R.java
Why are these paths different? Why is my R.java located in a debug folder in Android Studio? This lead to some errors early on, and if anyone has any insight into these differences I would appreciate them.
Simply put, Android Studio is configured to build a debug Build Type on your system.
Eclipse/ADT is designed to support a single build at a time (from what I can tell). One of the primary goals of the new build system (from the user guide):
Make it easy to create several variants of an application,
either for multi-apk distribution or for different flavors of an application
So where as Eclipse/ADT could generate one R.java file, Android Studio supports multiple. The generated R.java is located in the debug folder because by default the new build system supports debug and release build types off the bat. If you changed your build variant (button, lower left hand corner of AS) to release AS will generate R.java in the release directory.
This might not mean anything for simple projects, but the support of Build Variants means a drastic simplification of the build process for many developers, including the project I'm working on.
Our project supports 4 flavors with 2 build types (debug and release), to support a total of 8 different APK combinations. And each of those combinations have slightly different configurations, so this build system really worked out for us. My android studio is installed on a different machine, but if memory serves my correctly the R.java file exists in build/source/. When our CI server builds the APK files it uses each of these R.java files to generate separate packages.