无法升级到ProGuard的4.8以后要导出的应用 [英] Failed to export application after upgrade to Proguard 4.8

查看:258
本文介绍了无法升级到ProGuard的4.8以后要导出的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚升级我的Andr​​oid SDK,ADT和Proguard的最新和最伟大的。

I just upgraded my Android SDK, ADT and Proguard to the latest and greatest.

我的项目编译构建并运行正常在调试模式,但是当我尝试导出签署释放它APK,我从导出向导的收到一个错误,而不Eclipse控制台上的任何错误日志消息! *

My project compiles builds and runs fine in debug mode, but as soon as I try to export a signed release APK of it, I receive an error from the Export Wizard without any error log messages on the Eclipse console!*

如果我尝试通过查看错误日志窗口 - >显示视图>错误日志我看到的更多的是一样的:

If I try to view the error log via Window->Show View->Error Log all I see is more of the same:

我不知道该怎么办,因为Eclipse或Proguard的将给予任何提示关于这个问题可能是。

I have no idea what to do because neither Eclipse nor Proguard would give any hint about what the problem could be.

我的项目中导出罚款,直到最近这次升级。没有构建警告。没有lint警告!

My project exported fine until this recent upgrade. No build warnings. No lint warnings!

我使用Android的标准配置文件中的 $ {sdk.dir} \工具\ ProGuard的\ ProGuard的-android.txt

I am using the standard configuration file for Android in ${sdk.dir}\tools\proguard\proguard-android.txt:

-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose

-dontoptimize
-dontpreverify

-keepattributes *Annotation*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgent
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class * extends android.support.v4.app.Fragment
-keep public class * extends android.app.Fragment
-keep public class com.android.vending.licensing.ILicensingService

-keepclasseswithmembernames class * {
    native <methods>;
}

-keep public class * extends android.view.View {
    public <init>(android.content.Context);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
    public void set*(...);
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers class * extends android.app.Activity {
   public void *(android.view.View);
}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

-keepclassmembers class **.R$* {
    public static <fields>;
}

-dontwarn android.support.**

和我的项目的proguard.cfg只包含:

And my project's proguard.cfg only contains:

-assumenosideeffects class android.util.Log {
    public static *** v(...);
    public static *** i(...);
    public static *** d(...);
    public static *** w(...);
    public static *** e(...);
}

任何人看到过这个问题? 任何想法如何解决这一问题?

Anyone seen this problem before? Any idea how to fix this?

若干进展我能够导出一个签名的APK的第一次,因为我做这个升级:

Some progress? I was able to export a signed APK for the first time since I upgraded by doing this:

  1. 在我跑CCleaner的清理在Windows系统中的所有临时文件和缓存,
  2. 然后我重新启动Windows操作系统。

但让我失望的是,下一次我试图再次导出签署APK,我收到了同样的无法导出应用程序没有控制台消息!再次!

But to my dismay, the next time I tried to export the signed APK again, I received the same Failed to export application with no console messages! Again!

现在很清楚,我认为Android的开发工具已经变得不稳定。我真的不能运行CCleaner的每一次我要导出一个签名的APK重新启动Windows。我不在乎是谁的错:Android的SDK? ADT插件? Proguard的?

Now it's clear to me that the Android dev tools have become unstable. I can't really run CCleaner and reboot Windows every time I want to export a signed APK. And I don't care whose fault is it: Android SDK? ADT plugin? Proguard?

现在我该怎么办?

一些更大的进步?我尝试导出一个签名的APK使用ProGuard关闭。它导出行,但是当我启动它,它会立即崩溃了暂时无法找到应用程序的活动类( ClassNotFoundException的)。这是奇怪!它运行正常在调试模式下,如果应用程序的活动类的都没有了,它不应该编译!这是怎么回事?是最新的&放大器;最大的Andr​​oid开发工具坏了?

Some more progress? I tried exporting a signed APK with Proguard turned off. It exported OK but when I launch it, it immediately crashes for being unable to find the application's activity class (ClassNotFoundException). This is weird! It runs fine in debug mode and if the application's activity class weren't there, it shouldn't have compiled! What's going on? Are the latest & greatest Android dev tools broken?

我试图与订单和出口标签打在该解决方案(和这个太),但它并没有帮助。

I tried playing with the Order and Export tab as described in this solution (and this one too) but it didn't help.

现在我该怎么办?

推荐答案

您运行的是Windows XP,所以我不知道我能帮助(我运行Windows 7 64位),但您的评论,以@ BOE-开发关于17未解析引用的类提醒我最近的折磨我,升级你相似:

You're running Windows XP so I'm not sure I can help (I'm running Windows 7 64-bit) but your comment to @Boe-Dev about "17 unresolved references to classes" reminded me of my recent ordeal with an upgrade similar to yours:

解决它通过将下面的行 proguard.cfg

-dontwarn com.bta.myapp.MyAppActivity.R**

不知道你的问题是和我一样,但它可能是值得一试。

编辑:注意到,即使你有问题,你关闭Proguard的时候,我可以建议以下

Noticing that even when your turn off Proguard you are having problems, can I suggest the following?

  1. 从标准的Java构建路径中删除库:右键单击项目名称>属性> Java构建路径>标签库>删除一切除了机器人XX和Android的依赖关系
  2. 重命名库从LIB到库文件夹中。通过这样做,在文件夹库中的所有库由Android插件发现并添加到项目的Android的依赖关系项目
  3. 清洁项目(总是必要的,因为$如何取消p $ pdictable的Andr​​oid开发工具)

让我们知道它是如何工作的。

Let us know how it worked.

这篇关于无法升级到ProGuard的4.8以后要导出的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆