简体   繁体   English

Android build.xml库项目

[英]Android build.xml Libraryproject

I have a mainproject that references an android library project. 我有一个引用Android库项目的mainproject My mainproject should be builded, optimized and obfuscated using Proguard. 我的mainproject应该使用Proguard mainproject ,优化和混淆。 Therefore I used the buildscript described here . 所以我用描述的buildscript 这里 It's about 260 lines. 大约有260行。 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 . 我的default.properties通过android.library.reference.1=../RefProject了更改。 Since I've added this my buildscript fails with the error: 既然添加了此内容,我的buildscript就会失败并显示以下错误:

java.io.IOException: The output jar is empty. java.io.IOException:输出jar为空。 Did you specify the proper '-keep' options? 您是否指定了正确的“ -keep”选项? [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]位于proguard.shrink.Shrinker.execute(Shrinker.java:148)[java]位于proguard.ProGuard.shrink(ProGuard.java:275)[java]位于proguard.ProGuard.execute(ProGuard.java:101) [java]位于proguard.ProGuard.main(ProGuard.java:492)[java]注意:有1个对未知类的引用。 [java] You should check your configuration for typos. [java]您应该检查您的配置是否有错字。 [java] Ignoring unused library classes... [java] Original number of library classes: 2680 [java] Final number of library classes: 9 [java]忽略未使用的库类... [java]库类的原始数量:2680 [java]库类的最终数量: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? 有没有一种方法可以首先在我的mainproject中先构建库项目(实际上没有build.xml),然后再使用构建的apk(或者比它更jar?)?

Since ADT 14 all library projects should have their own build.xml files, as stated here . 由于ADT 14所有库项目都应该有自己build.xml文件,说明在这里 All your library project will be build before your main project, in order specified in your project.properties file. 将按照project.properties文件中指定的顺序在您的主项目之前构建所有库项目。 More details about library project you can find in official documentation . 您可以在官方文档中找到有关库项目的更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM