3

編譯我的Android應用的我的Ant腳本工作正常,但在將Google Play服務庫更新到版本5.0(修訂版18)後,ProGuard失敗並顯示以下輸出:將Google Play服務更新到版本5.0(修訂版18)後,ProGuard失敗

-obfuscate: 
    [mkdir] Created dir: /srv2/jenkins/jobs/CCNF Google only/workspace/trunk/org.digitalcure.ccnf.app/bin/proguard 
     [jar] Building jar: /srv2/jenkins/jobs/CCNF Google only/workspace/trunk/org.digitalcure.ccnf.app/bin/proguard/original.jar 
[proguard] ProGuard, version 4.7 
[proguard] Reading input... 
[proguard] Reading program jar [/srv2/jenkins/jobs/CCNF Google only/workspace/trunk/org.digitalcure.ccnf.app/bin/proguard/original.jar] 
[proguard] Reading program jar [/srv2/jenkins/jobs/CCNF Google only/workspace/trunk/org.digitalcure.android.common/bin/classes.jar] 
[proguard] Reading program jar [/srv2/jenkins/jobs/CCNF Google only/workspace/trunk/google-play-services_lib/bin/classes.jar] 
[proguard] Reading program jar [/srv2/jenkins/jobs/CCNF Google only/workspace/trunk/android-support-v7-appcompat/bin/classes.jar] 
[proguard] Reading program jar [/srv2/jenkins/jobs/CCNF Google only/workspace/trunk/android-support-v7-appcompat/libs/android-support-v7-appcompat.jar] 
[proguard] Reading program jar [/srv2/jenkins/jobs/CCNF Google only/workspace/trunk/android-support-v7-appcompat/libs/android-support-v4.jar] 
[proguard] Reading program jar [/srv2/jenkins/jobs/CCNF Google only/workspace/trunk/google-play-services_lib/libs/google-play-services.jar] 
[proguard] Reading library jar [/srv/jenkins/tools/android-sdk-linux/platforms/android-17/android.jar] 
[proguard] Initializing... 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle 
[proguard] Note: android.support.v4.app.NotificationCompatJellybean: can't find dynamically referenced class android.app.Notification$Action 
[proguard] Note: android.support.v4.text.ICUCompatIcs: can't find dynamically referenced class libcore.icu.ICU 
[proguard] Note: com.google.android.gms.maps.internal.u: can't find dynamically referenced class com.google.android.gms.maps.internal.CreatorImplGmm6 
[proguard] Note: com.google.android.gms.maps.internal.u: can't find dynamically referenced class com.google.android.gms.maps.internal.CreatorImpl 
[proguard] Note: the configuration refers to the unknown class 'com.google.vending.licensing.ILicensingService' 
[proguard] Note: the configuration refers to the unknown class 'com.android.vending.licensing.ILicensingService' 
[proguard] Note: the configuration refers to the unknown class 'Object' 
[proguard]  Maybe you meant the fully qualified name 'java.lang.Object'? 
[proguard] Note: the configuration refers to the unknown class 'fqcn.of.javascript.interface.for.webview' 
[proguard] Note: the configuration keeps the entry point 'com.google.ads.AdSize { AdSize(com.google.android.gms.ads.AdSize); }', but not the descriptor class 'com.google.android.gms.ads.AdSize' 
[proguard] Note: the configuration keeps the entry point 'com.google.ads.mediation.admob.AdMobAdapter { com.google.android.gms.ads.AdRequest a(android.content.Context,com.google.android.gms.ads.mediation.MediationAdRequest,android.os.Bundle,android.os.Bundle); }', but not the descriptor class 'com.google.android.gms.ads.mediation.MediationAdRequest' 
[proguard] Note: the configuration keeps the entry point 'com.google.ads.mediation.admob.AdMobAdapter { void requestBannerAd(android.content.Context,com.google.android.gms.ads.mediation.MediationBannerListener,android.os.Bundle,com.google.android.gms.ads.AdSize,com.google.android.gms.ads.mediation.MediationAdRequest,android.os.Bundle); }', but not the descriptor class 'com.google.android.gms.ads.mediation.MediationBannerListener' 
[proguard] Note: the configuration keeps the entry point 'com.google.ads.mediation.admob.AdMobAdapter { void requestBannerAd(android.content.Context,com.google.android.gms.ads.mediation.MediationBannerListener,android.os.Bundle,com.google.android.gms.ads.AdSize,com.google.android.gms.ads.mediation.MediationAdRequest,android.os.Bundle); }', but not the descriptor class 'com.google.android.gms.ads.AdSize' 
[proguard] Note: the configuration keeps the entry point 'com.google.ads.mediation.admob.AdMobAdapter { void requestBannerAd(android.content.Context,com.google.android.gms.ads.mediation.MediationBannerListener,android.os.Bundle,com.google.android.gms.ads.AdSize,com.google.android.gms.ads.mediation.MediationAdRequest,android.os.Bundle); }', but not the descriptor class 'com.google.android.gms.ads.mediation.MediationAdRequest' 
[proguard] Note: the configuration keeps the entry point 'com.google.ads.mediation.admob.AdMobAdapter { void requestInterstitialAd(android.content.Context,com.google.android.gms.ads.mediation.MediationInterstitialListener,android.os.Bundle,com.google.android.gms.ads.mediation.MediationAdRequest,android.os.Bundle); }', but not the descriptor class 'com.google.android.gms.ads.mediation.MediationInterstitialListener' 
[proguard] Note: the configuration keeps the entry point 'com.google.ads.mediation.admob.AdMobAdapter { void requestInterstitialAd(android.content.Context,com.google.android.gms.ads.mediation.MediationInterstitialListener,android.os.Bundle,com.google.android.gms.ads.mediation.MediationAdRequest,android.os.Bundle); }', but not the descriptor class 'com.google.android.gms.ads.mediation.MediationAdRequest' 
[proguard] Note: the configuration keeps the entry point 'com.google.ads.mediation.admob.AdMobAdapter$a { AdMobAdapter$a(com.google.ads.mediation.admob.AdMobAdapter,com.google.android.gms.ads.mediation.MediationBannerListener); }', but not the descriptor class 'com.google.android.gms.ads.mediation.MediationBannerListener' 
[proguard] Note: the configuration keeps the entry point 'com.google.ads.mediation.admob.AdMobAdapter$b { AdMobAdapter$b(com.google.ads.mediation.admob.AdMobAdapter,com.google.android.gms.ads.mediation.MediationInterstitialListener); }', but not the descriptor class 'com.google.android.gms.ads.mediation.MediationInterstitialListener' 
[proguard] Note: the configuration keeps the entry point 'com.google.ads.mediation.customevent.CustomEventAdapter { void requestBannerAd(com.google.ads.mediation.MediationBannerListener,android.app.Activity,com.google.ads.mediation.customevent.CustomEventServerParameters,com.google.ads.AdSize,com.google.ads.mediation.MediationAdRequest,com.google.android.gms.ads.mediation.customevent.CustomEventExtras); }', but not the descriptor class 'com.google.android.gms.ads.mediation.customevent.CustomEventExtras' 
[proguard] Note: the configuration keeps the entry point 'com.google.ads.mediation.customevent.CustomEventAdapter { void requestInterstitialAd(com.google.ads.mediation.MediationInterstitialListener,android.app.Activity,com.google.ads.mediation.customevent.CustomEventServerParameters,com.google.ads.mediation.MediationAdRequest,com.google.android.gms.ads.mediation.customevent.CustomEventExtras); }', but not the descriptor class 'com.google.android.gms.ads.mediation.customevent.CustomEventExtras' 
[proguard] Note: there were 4 references to unknown classes. 
[proguard]  You should check your configuration for typos. 
[proguard] Note: there were 11 unkept descriptor classes in kept class members. 
[proguard]  You should consider explicitly keeping the mentioned classes 
[proguard]  (using '-keep'). 
[proguard] Note: there were 5 unresolved dynamic references to classes or interfaces. 
[proguard]  You should check if you need to specify additional program jars. 
[proguard] Warning: there were 9 unresolved references to classes or interfaces. 
[proguard]   You may need to specify additional library jars (using '-libraryjars'). 

它與前者(工作)輸出進行比較,下面幾行是新的:

[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager 
[proguard] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle 
[proguard] Note: android.support.v4.app.NotificationCompatJellybean: can't find dynamically referenced class android.app.Notification$Action 

加在輸出末端的錯誤消息。

發生了什麼事?它接縫,android.view.accessibility.CaptioningManager引入了API級別19.

回答

10

我注意到,Android支持庫的目標版本從16更改爲19(同時更新到版本20)。我的應用程序是針對目標版本17構建的。所以我將主應用程序項目的目標版本從17更改爲19,現在一切正常。而已!

+0

感謝名單顯示 - 這解決了我的問題! –

+1

謝謝 - 這解決了我的問題。這對某些人來說可能是顯而易見的,但要清楚一點:它位於項目設置的Android部分,您需要將目標版本更改爲> = 19。起初,我只是笨到認爲將清單中的目標SDK版本從17更改爲19就足夠了,這當然不是。 – Trevor

4

對於誰@ stefan222的答案沒有工作,你可以添加

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

您proguard.cfg

做到這一點需要您自擔風險雖然人。如果你添加了,確保你測試你的應用程序。

0

對於誰想要擺脫警告人們:

所以沒有警告將在所有

-dontwarn com.google.android.gms.** 
相關問題