1
Sometimes I need to use one project in another like a UI framework in my application or something like that and most of them are available in repositories like github etc, I usually download and extract the files to my project folder but soon the eclipse starts to alert several errors usually for two reasons
- Import it from the class
R
the package is wrong or is it usually refers to the original package of the framework not to mine project (Thing Obvia rsrs) - The class
R
does not identify Resources and they often stay inaccessible
I believe that I am probably embedding one project in the other wrong way I would like to know how I can do it in a simple way, every time I decide to use some UI Framework is a Erra I need to fix all these errors at hand.
Could you answer the following questions? Are you placing the library fonts directly in your project (module)? Which IDE is using (Eclipse, Android Studio or other)? Which build system (ant, Gradle or Maven)? It could also include the link of one of these Ibraries?
– Wakim
I’m using Eclipse my build system is the eclipse pattern, I’m putting the fonts right into the project, the classes and the xml layout files, one of the projects I’m including is this https://github.com/JakeWharton/ActionBarSherlock
– Tuyoshi Vinicius
As I do not use Eclipse for Android development, I can not generate a satisfactory answer. But I leave my contribution: Whenever you check out a library repository, try to create a separate Eclipse (module) project for it (having your own folder
res
and your ownAndroidManifest
), with this you already avoid problems with references to classR
, because each project has one. Take a look at http://www.simpligility.com/2010/07/multi-module-android-project-in-eclipse/. More...– Wakim
Eclipse uses Ant to build and generate APK. I think it is possible to use Maven to manage your dependencies, I say this because many Maven modules (e.g : https://github.com/ManuelPeinado/GlassActionBar) submit modules to Maven Repository, using Maven or Gradle it is very easy to include in your code (https://gist.github.com/wakim/42ee30ceb958a3f80110), thus avoiding the problem of use.
– Wakim
When starting a new Android project, from a look at Android Studio, may be personal opinion but never go back to Eclipse after I changed, no comparison.
– Wakim
@Wakim actually I also prefer the Android Studio rs I chose to use the eclipse because these library were with the eclipse build. Thanks for the tips.
– Tuyoshi Vinicius