使用Proguard和GoogleAdMobAdsSdk-6.0.1.jar(AdMob)的错误

时间:2012-06-21 17:37:41

标签: android proguard

并提前致谢!

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


[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组合!谁知道问题出在哪里! 任何反馈将不胜感激!

再次感谢,并问候!!

1 个答案:

答案 0 :(得分:0)

你有没有试过保留所有包裹?

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