2014-04-26 97 views
3

我試驗問題使用ProGuard和新的AdMob庫(谷歌Play服務庫項目)簽署我的應用程序的問題使用ProGuard和AdMob

控制檯是給我的這些錯誤:

[2014-04-26 16:41:33 - MyProject] Proguard returned with error code 1. See console 
[2014-04-26 16:41:33 - MyProject] Warning: com.google.android.gms.analytics.GoogleAnalytics$b: can't find superclass or interface android.app.Application$ActivityLifecycleCallbacks 
[2014-04-26 16:41:33 - MyProject] Warning: com.google.android.gms.common.images.ImageManager$e: can't find superclass or interface android.content.ComponentCallbacks2 
[2014-04-26 16:41:33 - MyProject] Warning: com.google.android.gms.analytics.GoogleAnalytics: can't find referenced class android.app.Application$ActivityLifecycleCallbacks 
[2014-04-26 16:41:33 - MyProject] Warning: com.google.android.gms.analytics.GoogleAnalytics: can't find referenced method 'void registerActivityLifecycleCallbacks(android.app.Application$ActivityLifecycleCallbacks)' in class android.app.Application 
[2014-04-26 16:41:33 - MyProject] Warning: com.google.android.gms.analytics.GoogleAnalytics$b: can't find referenced class android.app.Application$ActivityLifecycleCallbacks 
[2014-04-26 16:41:33 - MyProject] Warning: com.google.android.gms.common.images.ImageManager: can't find referenced method 'void registerComponentCallbacks(android.content.ComponentCallbacks)' in class android.content.Context 
[2014-04-26 16:41:33 - MyProject] Warning: com.google.android.gms.common.images.ImageManager$e: can't find referenced class android.content.ComponentCallbacks2 
[2014-04-26 16:41:33 - MyProject] Warning: com.google.android.gms.common.images.a: can't find referenced method 'android.graphics.drawable.Drawable[] getCompoundDrawablesRelative()' in class android.widget.TextView 
[2014-04-26 16:41:33 - MyProject] Warning: com.google.android.gms.common.images.a: can't find referenced method 'void setCompoundDrawablesRelativeWithIntrinsicBounds(android.graphics.drawable.Drawable,android.graphics.drawable.Drawable,android.graphics.drawable.Drawable,android.graphics.drawable.Drawable)' in class android.widget.TextView 
[2014-04-26 16:41:33 - MyProject] Warning: com.google.android.gms.internal.cx: can't find referenced method 'java.lang.String getDefaultUserAgent(android.content.Context)' in class android.webkit.WebSettings 
[2014-04-26 16:41:33 - MyProject] Warning: com.google.android.gms.internal.cx: can't find referenced method 'void setMediaPlaybackRequiresUserGesture(boolean)' in class android.webkit.WebSettings 
[2014-04-26 16:41:33 - MyProject] Warning: com.google.android.gms.internal.gd$b: can't find referenced method 'android.view.Display getDisplay()' in class android.view.View 
[2014-04-26 16:41:33 - MyProject] Warning: com.google.android.gms.internal.gd$b: can't find referenced method 'void removeOnGlobalLayoutListener(android.view.ViewTreeObserver$OnGlobalLayoutListener)' in class android.view.ViewTreeObserver 
[2014-04-26 16:41:33 - MyProject]  You should check if you need to specify additional program jars. 
[2014-04-26 16:41:33 - MyProject] Warning: there were 5 unresolved references to classes or interfaces. 
[2014-04-26 16:41:33 - MyProject]   You may need to specify additional library jars (using '-libraryjars'). 
[2014-04-26 16:41:33 - MyProject] Warning: there were 8 unresolved references to program class members. 
[2014-04-26 16:41:33 - MyProject]   Your input classes appear to be inconsistent. 
[2014-04-26 16:41:33 - MyProject]   You may need to recompile them and try again. 
[2014-04-26 16:41:33 - MyProject]   Alternatively, you may have to specify the option 
[2014-04-26 16:41:33 - MyProject]   '-dontskipnonpubliclibraryclassmembers'. 
[2014-04-26 16:41:33 - MyProject] java.io.IOException: Please correct the above warnings first. 
[2014-04-26 16:41:33 - MyProject] at proguard.Initializer.execute(Initializer.java:321) 
[2014-04-26 16:41:33 - MyProject] at proguard.ProGuard.initialize(ProGuard.java:211) 
[2014-04-26 16:41:33 - MyProject] at proguard.ProGuard.execute(ProGuard.java:86) 
[2014-04-26 16:41:33 - MyProject] at proguard.ProGuard.main(ProGuard.java:492) 

我在互聯網上找不到解決這個問題的方法。

回答

7

也許你應該添加到您的proguard.txt

-dontwarn com.google.android.gms.** 

好運。

+1

mmmmm,它似乎工作!謝謝。你在哪找到的? – NullPointerException

+0

@ AndroidUser99只需要用你的標題搜索谷歌搜索。 –