1

并提前感谢!

我已经尝试了几个小时,6 个或更长时间!但是每次我尝试生成签名/未签名的 apk 时,Proguard 都会删除此错误消息:


[2012-06-21 19:24:30 - SuperMarket] Proguard returned with error code 1. See console
[2012-06-21 19:24:30 - SuperMarket] Note: there were 2919 duplicate class definitions.
[2012-06-21 19:24:30 - SuperMarket] Warning: com.google.ads.util.g: can't find referenced method 'void setLayerType(int,android.graphics.Paint)' in class android.view.View
[2012-06-21 19:24:30 - SuperMarket] Warning: com.google.ads.util.g: can't find referenced method 'void setDisplayZoomControls(boolean)' in class android.webkit.WebSettings
[2012-06-21 19:24:30 - SuperMarket] Warning: com.google.ads.util.g$b: can't find referenced class android.webkit.WebResourceResponse
[2012-06-21 19:24:30 - SuperMarket] Warning: com.google.ads.util.g$b: can't find referenced class android.webkit.WebResourceResponse
[2012-06-21 19:24:30 - SuperMarket] Warning: com.google.ads.util.g$b: can't find referenced method 'android.webkit.WebResourceResponse shouldInterceptRequest(android.webkit.WebView,java.lang.String)' in class com.google.ads.internal.i
[2012-06-21 19:24:30 - SuperMarket] Warning: com.google.ads.util.g$b: can't find referenced class android.webkit.WebResourceResponse
[2012-06-21 19:24:30 - SuperMarket] Warning: com.google.ads.util.g$b: can't find referenced class android.webkit.WebResourceResponse
[2012-06-21 19:24:30 - SuperMarket]       You should check if you need to specify additional program jars.
[2012-06-21 19:24:30 - SuperMarket] Warning: there were 4 unresolved references to classes or interfaces.
[2012-06-21 19:24:30 - SuperMarket]          You may need to specify additional library jars (using '-libraryjars').
[2012-06-21 19:24:30 - SuperMarket] Warning: there were 3 unresolved references to program class members.
[2012-06-21 19:24:30 - SuperMarket]          Your input classes appear to be inconsistent.
[2012-06-21 19:24:30 - SuperMarket]          You may need to recompile them and try again.
[2012-06-21 19:24:30 - SuperMarket]          Alternatively, you may have to specify the option 
[2012-06-21 19:24:30 - SuperMarket]          '-dontskipnonpubliclibraryclassmembers'.
[2012-06-21 19:24:30 - SuperMarket] Error: Please correct the above warnings first.

我试过这个 proguard.cfg:


-dontpreverify
-repackageclasses ''
-allowaccessmodification
-optimizations !code/simplification/arithmetic
-keepattributes *Annotation*

-injar C:\Users\Jordi\android-sdks\platforms\android-10\android.jar
-libraryjars C:\Users\Jordi\android-sdks\extras\google\admob_ads_sdk\GoogleAdMobAdsSdk-6.0.1.jar
-libraryjars C:\Users\Jordi\android-sdks\tools\support\annotations.jar

-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.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.content.Context {
   public void *(android.view.View);
   public void *(android.view.MenuItem);
}

-keepclassmembers class * implements android.os.Parcelable {
    static android.os.Parcelable$Creator CREATOR;
}

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

-keep public class com.google.ads.** { public protected *; }

以及许多其他的 injar/libraryjars 组合!任何人都知道问题可能出在哪里!任何反馈将不胜感激!

再次感谢,问候!!

4

1 回答 1

0

你试过保留所有的包裹吗?

-keep class com.google.ads** { *; }

于 2012-07-24T13:50:49.263 回答