ant release proguard失败了,但在eclipse下工作

时间:2014-11-13 23:48:26

标签: android eclipse ant proguard release-mode

我有一个非常大的项目,精心制作的proguard.cfg。

  • 这个项目在eclipse下构建正常,proguard运行没有错误,应用程序运行良好,几个月来一直是我的正常工作流程。

我正在尝试使用ant从命令行构建它。

我已使用

更新了项目及其库项目的build.xml等
 android update project -p .
 android update project -s --target android-17 -p .
  • 调试版ant debug已成功构建
  • 但是,ant release失败proguard,抱怨缺少课程。

从我可以破译的内容(弹出很多非故障警告)来看,这些问题与我(一千个)类中缺少的内部类以及缺少依赖库项目的R(资源)有关。这很奇怪,两者都存在,图书馆项目可以从eclipse& amp;蚂蚁,那个内心阶级我不知道,父母班级是非常微不足道的。

为什么它在eclipse下构建而不使用命令行?更新的构建脚本不应该产生相同的结果吗?

Proguard:与LIbrary项目资源相关的错误

 [proguard] Warning: com.jeremyfeinstein.slidingmenu.lib.CustomViewBehind: can't find referenced class com.jeremyfeinstein.slidingmenu.lib.R$id
 [proguard] Warning: com.jeremyfeinstein.slidingmenu.lib.CustomViewBehind: can't find referenced class com.jeremyfeinstein.slidingmenu.lib.R$id
 [proguard] Warning: com.jeremyfeinstein.slidingmenu.lib.CustomViewBehind: can't find referenced class com.jeremyfeinstein.slidingmenu.lib.R
 [proguard] Warning: com.jeremyfeinstein.slidingmenu.lib.SlidingMenu: can't find referenced class com.jeremyfeinstein.slidingmenu.lib.R$styleable
 [proguard] Warning: com.jeremyfeinstein.slidingmenu.lib.SlidingMenu: can't find referenced class com.jeremyfeinstein.slidingmenu.lib.R$styleable
 [proguard] Warning: com.jeremyfeinstein.slidingmenu.lib.SlidingMenu: can't find referenced class com.jeremyfeinstein.slidingmenu.lib.R
 [proguard] Warning: com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityHelper: can't find referenced class com.jeremyfeinstein.slidingmenu.lib.R$layout
 [proguard] Warning: com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityHelper: can't find referenced class com.jeremyfeinstein.slidingmenu.lib.R$layout
 [proguard] Warning: com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityHelper: can't find referenced class com.jeremyfeinstein.slidingmenu.lib.R

Proguard:未找到与内部类相关的

 [proguard] Warning: com.regaliz.gui.layouts.FunqRootLayout$2: can't find referenced class com.regaliz.gui.layouts.FunqRootLayout$1
 [proguard] Warning: com.regaliz.gui.layouts.FunqRootLayout$3: can't find referenced class com.regaliz.gui.layouts.FunqRootLayout$1
 [proguard] Warning: com.regaliz.gui.layouts.FunqRootLayout$SimpleAnimationListener: can't find referenced class com.regaliz.gui.layouts.FunqRootLayout$1
 [proguard] Warning: com.regaliz.gui.layouts.FunqRootLayout$SimpleAnimationListener: can't find referenced class com.regaliz.gui.layouts.FunqRootLayout$1
 [proguard] Warning: com.regaliz.gui.layouts.FunqRootLayout$SimpleAnimationListener: can't find referenced class com.regaliz.gui.layouts.FunqRootLayout$1

1 个答案:

答案 0 :(得分:0)

奇怪的是,我通过反复试验找到了问题。

未找到的内部类是一个无辜的私人匿名运行,如:

private Runnable mBlinkRunner=new Runnable() {

    public void run() {
        .
        . couple simple lines 
        .

    }
};

我把它改成了......

protected Runnable mBlinkRunner=new Runnable() {

    public void run() {
        .
        . couple simple lines 
        .

    }
};

并且它有效...我想知道为什么会发生这种情况,通过该项目应该有类似数百个可运行的运行。