Tuesday, October 25, 2011

[android-developers] Android Tools R14 including external source?

Hi All,

I work for a company whose product is pretty complicated, but I
suspect this is not uncommon and there must be someone out there who
is doing something similar. I am trying to port our build.xml to the
new R14 format and have encountered a strange problem. We need to
build some external java source code into .jar files during the
Android build at some point. I was looking though the new build.xml
files and thought I would use the new -pre-build extension target (I
also tried -pre-compile and get similar results):

<!-- extension targets. Uncomment the ones where you want to do custom
work
in between standard targets -->
<target name="-pre-build">
<subant target="dist.android" failonerror="true" inheritall="false"
inheritrefs="false">
<fileset dir="../../../SDK/Java" includes="build.xml"/>
</subant>
<copy file="../../../SDK/Java/dist/Android.Client.jar" todir="../
MyLibProject/libs"/>
<copy file="../../../SDK/Java/dist/Client.jar" todir="../
MyLibProject/libs"/>
</target>

I can see that the two .JAR files are created and copied into the
directory prior to the build, and the source code is compiled against
those .JAR files because there are no compiler errors. However the
final .apk file does not contain the classes in these .JAR files.

If I run the ant build again, the resulting .apk is larger, showing
that the class files inside the .JAR files are being included. I don`t
really want to have to run the build twice to get correct .APK files.

Recently we changed from adding pre-compiled .jar files into our /libs
directory to building directly from the source code and have noticed
this problem even on a previous R12 build server.

How do people deal with this?

Thanks in advance,

-Neal

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate