I have a mainproject
that references an android library project开发者_开发知识库.
My mainproject
should be builded, optimized and obfuscated using Proguard. Therefore I used the buildscript described here. It's about 260 lines. Too much to post it here.
Now I've added a reference to a library project. My default.properties
got changed with android.library.reference.1=../RefProject
. Since I've added this my buildscript fails with the error:
java.io.IOException: The output jar is empty. Did you specify the proper '-keep' options? [java] at proguard.shrink.Shrinker.execute(Shrinker.java:148) [java] at proguard.ProGuard.shrink(ProGuard.java:275) [java] at proguard.ProGuard.execute(ProGuard.java:101) [java] at proguard.ProGuard.main(ProGuard.java:492) [java] Note: there were 1 references to unknown classes. [java] You should check your configuration for typos. [java] Ignoring unused library classes... [java] Original number of library classes: 2680 [java] Final number of library classes: 9
Furthermore it would be cool if my library project will be optimized and obfuscated first and than used by the main project.
Is there a way to first build the library project (it has actually no build.xml) first and than use the builded apk (or is it a jar than?) in my mainproject?
Since ADT 14 all library projects should have their own build.xml
files, as stated here. All your library project will be build before your main project, in order specified in your project.properties
file. More details about library project you can find in official documentation.
精彩评论