在签名生成apk文件时出现 Proguard returned with error code 1. See console

今天在为app签名发布的时候,在最后生成apk文件的时候出现了错误:

Proguard returned with error code 1. See console


控制台输出信息如下:

[2012-05-14 14:58:50 - My_App] Proguard returned with error code 1. See console

[2012-05-14 14:58:50 - My_App] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64

[2012-05-14 14:58:50 - My_App] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64

[2012-05-14 14:58:50 - My_App] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64

[2012-05-14 14:58:50 - My_App] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64

[2012-05-14 14:58:50 - My_App] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.CommonsLoggingLoggerFactory: can't find referenced class org.apache.commons.logging.LogFactory

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.CommonsLoggingLoggerFactory: can't find referenced class org.apache.commons.logging.LogFactory

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Level

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Level

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.Log4JLoggerFactory: can't find referenced class org.apache.log4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.Log4JLoggerFactory: can't find referenced class org.apache.log4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.SLF4JLoggerFactory: can't find referenced class org.slf4j.LoggerFactory

[2012-05-14 14:58:50 - My_App] Warning: twitter4j.internal.logging.SLF4JLoggerFactory: can't find referenced class org.slf4j.LoggerFactory

[2012-05-14 14:58:50 - My_App]       You should check if you need to specify additional program jars.

[2012-05-14 14:58:50 - My_App] Warning: there were 33 unresolved references to classes or interfaces.

[2012-05-14 14:58:50 - My_App]          You may need to specify additional library jars (using '-libraryjars').

[2012-05-14 14:58:50 - My_App] java.io.IOException: Please correct the above warnings first.

[2012-05-14 14:58:50 - My_App] at proguard.Initializer.execute(Initializer.java:321)

[2012-05-14 14:58:50 - My_App] at proguard.ProGuard.initialize(ProGuard.java:211)

[2012-05-14 14:58:50 - My_App] at proguard.ProGuard.execute(ProGuard.java:86)

[2012-05-14 14:58:50 - My_App] at proguard.ProGuard.main(ProGuard.java:492)

[2012-05-14 15:01:04 - My_App] Proguard returned with error code 1. See console


我的proguard.cfg文件内容如下:

-optimizationpasses 5

-dontusemixedcaseclassnames

-dontskipnonpubliclibraryclasses

-dontpreverify

-verbose

-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*


-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.BackupAgentHelper

-keep public class * extends android.preference.Preference

-keep public class com.android.vending.licensing.ILicensingService


-keepclasseswithmembernames class * {

    native <methods>;

}


-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 *;

}



临时解决方法:直接把 

proguard.config=proguard.cfg

这个配置给删除掉,就可以成功签名生成apk了

很明显不是网上所说的路径或者空格的问题,是使用proguard时有关外来jar包所带来的问题,找不到相应的class文件

所以解决方法: 根据提示,在proguard.cfg文件中添加:

-dontwarn twitter4j.internal.logging.**

-dontwarn oauth.signpost.signature.**


解决!



参考资料:

http://stackoverflow.com/questions/8030532/using-proguard-to-obfuscate-android-app-with-dropbox-com-libraries

http://blog.csdn.net/aa4790139/article/details/6754230

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值