简体   繁体   English

签名的应用程序出现Proguard错误

[英]Error with Proguard when signed application

I want to signed my application so i had enabled proguard to my application but when i signed then it show error like this in console 我想对我的应用程序进行签名,所以我已经为我的应用程序启用了proguard,但是当我签名时,它在控制台中显示了这样的错误

[2016-03-09 09:09:44 - xxx] Proguard returned with error code 1. See console
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw$zza: can't find superclass or interface org.apache.http.client.methods.HttpEntityEnclosingRequestBase
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzac: can't find referenced class android.net.http.AndroidHttpClient
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzac: can't find referenced class android.net.http.AndroidHttpClient
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.Header
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.Header
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.HttpEntity
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.HttpResponse
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.StatusLine
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.impl.cookie.DateUtils
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.impl.cookie.DateUtils
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.Header
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.Header
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.HttpEntity
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.HttpEntity
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.HttpEntity
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.HttpResponse
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.HttpResponse
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.HttpResponse
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.StatusLine
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.StatusLine
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.StatusLine
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.HttpEntity
[2016-03-09 09:09:44 - xxx Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.Header
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzt: can't find referenced class org.apache.http.Header
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.HttpClient
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpDelete
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpGet
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpHead
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpOptions
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpPost
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpPut
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpTrace
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpUriRequest
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.entity.ByteArrayEntity
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced method 'void addHeader(java.lang.String,java.lang.String)' in class com.google.android.gms.internal.zzw$zza
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpDelete
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpGet
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpHead
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpOptions
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpPost
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpPost
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpPost
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpPut
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpPut
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpTrace
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.entity.ByteArrayEntity
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.HttpClient
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpUriRequest
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpUriRequest
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.HttpClient
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.HttpClient
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpUriRequest
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpUriRequest
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.HttpResponse
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.HttpResponse
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpUriRequest
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpUriRequest
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw: can't find referenced class org.apache.http.client.methods.HttpUriRequest
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw$zza: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw$zza: can't find referenced method 'void setURI(java.net.URI)' in class com.google.android.gms.internal.zzw$zza
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzw$zza: can't find referenced class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.impl.cookie.DateParseException
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.impl.cookie.DateUtils
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzx: can't find referenced class org.apache.http.impl.cookie.DateUtils
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzy: can't find referenced class org.apache.http.HttpResponse
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzy: can't find referenced class org.apache.http.HttpResponse
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.ProtocolVersion
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.entity.BasicHttpEntity
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.message.BasicHeader
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.message.BasicHttpResponse
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.message.BasicStatusLine
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.ProtocolVersion
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.entity.BasicHttpEntity
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.entity.BasicHttpEntity
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.entity.BasicHttpEntity
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.entity.BasicHttpEntity
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.entity.BasicHttpEntity
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.message.BasicHeader
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.message.BasicHttpResponse
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.message.BasicHttpResponse
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.message.BasicHttpResponse
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.message.BasicStatusLine
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.HttpResponse
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.HttpResponse
[2016-03-09 09:09:44 - xxx] Warning: com.google.android.gms.internal.zzz: can't find referenced class org.apache.http.HttpEntity
[2016-03-09 09:09:44 - xxx]       You should check if you need to specify additional program jars.
[2016-03-09 09:09:44 - xxx] Warning: there were 87 unresolved references to classes or interfaces.
[2016-03-09 09:09:44 - xxx]          You may need to specify additional library jars (using '-libraryjars').
[2016-03-09 09:09:44 - xxx] Warning: there were 2 unresolved references to program class members.
[2016-03-09 09:09:44 - xxx]          Your input classes appear to be inconsistent.
[2016-03-09 09:09:44 - xxx]          You may need to recompile them and try again.
[2016-03-09 09:09:44 - xxx]          Alternatively, you may have to specify the option 
[2016-03-09 09:09:44 - xxx]          '-dontskipnonpubliclibraryclassmembers'.
[2016-03-09 09:09:44 - xxx] java.io.IOException: Please correct the above warnings first.
[2016-03-09 09:09:44 - xxx]     at proguard.Initializer.execute(Initializer.java:321)
[2016-03-09 09:09:44 - xxx]     at proguard.ProGuard.initialize(ProGuard.java:211)
[2016-03-09 09:09:44 - xxx]     at proguard.ProGuard.execute(ProGuard.java:86)
[2016-03-09 09:09:44 - xxx]     at proguard.ProGuard.main(ProGuard.java:492)

Is there a way to fix it? 有办法解决吗? as i know the proguard error in there with google play service too 因为我也知道Google Play服务中的proguard错误

and in there at this line 在那条线

[2016-03-09 09:09:44 - xxx]       You should check if you need to specify additional program jars.
[2016-03-09 09:09:44 - xxx] Warning: there were 87 unresolved references to classes or interfaces.
[2016-03-09 09:09:44 - xxx]          You may need to specify additional library jars (using '-libraryjars').
[2016-03-09 09:09:44 - xxx] Warning: there were 2 unresolved references to program class members.
[2016-03-09 09:09:44 - xxx]          Your input classes appear to be inconsistent.
[2016-03-09 09:09:44 - xxx]          You may need to recompile them and try again.
[2016-03-09 09:09:44 - xxx]          Alternatively, you may have to specify the option 
[2016-03-09 09:09:44 - xxx]          '-dontskipnonpubliclibraryclassmembers'.
[2016-03-09 09:09:44 - xxx] java.io.IOException: Please correct the above warnings first.
[2016-03-09 09:09:44 - xxx]     at proguard.Initializer.execute(Initializer.java:321)
[2016-03-09 09:09:44 - xxx]     at proguard.ProGuard.initialize(ProGuard.java:211)
[2016-03-09 09:09:44 - xxx]     at proguard.ProGuard.execute(ProGuard.java:86)
[2016-03-09 09:09:44 - xxx]     at proguard.ProGuard.main(ProGuard.java:492)

there is something unresolved 有一些未解决的问题

file in proguard project 在proguard项目中归档

# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}
#-keep class * extends java.util.ListResourceBundle {
#    protected Object[][] getContents();
#}

#-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
#    public static final *** NULL;
#}

#-keepnames @com.google.android.gms.common.annotation.KeepName class *
#-keepclassmembernames class * {
#    @com.google.android.gms.common.annotation.KeepName *;
#}

#-keepnames class * implements android.os.Parcelable {
#    public static final ** CREATOR;
#}

-keep class com.google.android.gms.ads.**

I use "#" to rules in there because i dont know the function so ijust use -keep class com.google.android.gms.ads.* * 我在其中使用“#”作为规则,因为我不知道该函数,因此我只使用-keep class com.google.android.gms.ads.* *

can anyone explain this why? 谁能解释这个原因?

please replace your proguard file with this proguard file. 请用此proguard文件替换您的proguard文件。

Proguardrule.pro Proguardrule.pro

# This is a configuration file for ProGuard.
# http://proguard.sourceforge.net/index.html#manual/usage.html
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose

# Optimization is turned off by default. Dex does not like code run
# through the ProGuard optimize and preverify steps (and performs some
# of these optimizations on its own).
#-dontoptimize
#-dontpreverify

# If you want to enable optimization, you should include the
# following:
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
-optimizationpasses 5
-allowaccessmodification
#
# Note that you cannot just include these flags in your own
# configuration file; if you are including this file, optimization
# will be turned off. You'll need to either edit this file, or
# duplicate the contents of this file and remove the include of this
# file from your project's proguard.config path property.

-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.preference.Preference
-keep public class * extends android.support.v4.app.Fragment
-keep public class * extends android.support.v4.app.DialogFragment
-keep public class * extends com.actionbarsherlock.app.SherlockListFragment
-keep public class * extends com.actionbarsherlock.app.SherlockFragment
-keep public class * extends com.actionbarsherlock.app.SherlockFragmentActivity
-keep public class * extends android.app.Fragment
-keep public class com.android.vending.licensing.ILicensingService

# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-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);
}

# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-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>;
}

-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
-keep class com.actionbarsherlock.** { *; }
-keep interface com.actionbarsherlock.** { *; }
# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version. We know about them, and they are safe.
-dontwarn android.support.**
-dontwarn com.google.ads.**

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

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