A problem is currently running when our production build using ant excludes the R.class file. Looking at the ADT build.xml, I see the following:
<if condition="${project.is.library}">
<then>
...
<jar destfile="${out.library.jar.file}">
<fileset dir="${out.classes.absolute.dir}"
includes="**/*.class"
excludes="${project.app.package.path}/R.class ${project.app.package.path}/R$*.class ${project.app.package.path}/BuildConfig.class"/>
<fileset dir="${source.absolute.dir}"
excludes="**/*.java ${android.package.excludes}" />
</jar>
</then>
</if>
Currently, the assembly grabs the classes.jar file, but as you can see above, this does not include the R.class file, so when the library tries to grab the external line, it explodes on NoClassDefFoundError
Update:
The following quote was given here: http://tools.android.com/recent/dealingwithdependenciesinandroidprojects
Important change:
We have changed the way library projects and class packages are generated:
- Class R is not yet packaged in the library library project output file.
- R , . R .
, R- , . , R . , R , , , R .
, , Android?
2:
, R.class R $*. jar.
, "" Android, ADT . "" , .