I'm trying to add an external jar library to my Android project. It compiles and downloads to my device correctly but I'm getting the following logcat:
The problem seems to be that the R class isn't included in the library compilation. Through this question I arrived here where this confusing text states
So, I'm kind of stuck. How do I/Can I force a library to include its needed resources? If not, how can I use the R class in a library which I want to make available without sharing my project code? | |||
Android library projects are different from normal libraries. For versions of Android before API level 14, you cannot compile them into standalone jar files and include into your projects. Instead, you need to include them as library projects with your own Android project. That means that you need to have the full source code of the library project. Without it, you cannot use it as a library project. When you include it as a library project into your own Android project and compile your project, the build tools will combine the resource definitions (R classes) from the library projects and your own projects and create one R class. You will then have access to resources from both your own project and library projects. Starting with API level 14 library projects can be compiled into standalone jars and you can find the info on how to do this on google's developer's documentation site. Have a read through Android Library Projects documentation for more information. | ||||
default
.
stackoverflow.comm
No comments:
Post a Comment