Android - Proguard 和 Google Play 服务的应用程序导出错误

标签 android google-play-services proguard

我已将最新的 Google Play 服务添加到项目中,现在混淆器正在提供 我有很多警告:

[2014-07-31 17:21:50 - MyApp] Proguard returned with error code 1. See console
[2014-07-31 17:21:50 - MyApp] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager
[2014-07-31 17:21:50 - MyApp] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2014-07-31 17:21:50 - MyApp] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2014-07-31 17:21:50 - MyApp] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2014-07-31 17:21:50 - MyApp] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2014-07-31 17:21:50 - MyApp] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2014-07-31 17:21:50 - MyApp] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager
[2014-07-31 17:21:50 - MyApp] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager
[2014-07-31 17:21:50 - MyApp] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2014-07-31 17:21:50 - MyApp] Warning: com.google.android.gms.common.SupportErrorDialogFragment: can't find referenced method 'void setShowsDialog(boolean)' in class com.google.android.gms.common.SupportErrorDialogFragment
[2014-07-31 17:21:50 - MyApp] Warning: com.google.android.gms.common.api.d: can't find referenced method 'android.support.v4.app.FragmentActivity getActivity()' in class com.google.android.gms.common.api.d
[2014-07-31 17:21:50 - MyApp]       You should check if you need to specify additional program jars.
[2014-07-31 17:21:50 - MyApp] Warning: there were 9 unresolved references to classes or interfaces.
[2014-07-31 17:21:50 - MyApp]          You may need to specify additional library jars (using '-libraryjars').
[2014-07-31 17:21:50 - MyApp] Warning: there were 2 unresolved references to program class members.
[2014-07-31 17:21:50 - MyApp]          Your input classes appear to be inconsistent.
[2014-07-31 17:21:50 - MyApp]          You may need to recompile them and try again.
[2014-07-31 17:21:50 - MyApp]          Alternatively, you may have to specify the option 
[2014-07-31 17:21:50 - MyApp]          '-dontskipnonpubliclibraryclassmembers'.
[2014-07-31 17:21:50 - MyApp] java.io.IOException: Please correct the above warnings first.
[2014-07-31 17:21:50 - MyApp]   at proguard.Initializer.execute(Initializer.java:321)
[2014-07-31 17:21:50 - MyApp]   at proguard.ProGuard.initialize(ProGuard.java:211)
[2014-07-31 17:21:50 - MyApp]   at proguard.ProGuard.execute(ProGuard.java:86)
[2014-07-31 17:21:50 - MyApp]   at proguard.ProGuard.main(ProGuard.java:492)

我试过添加

-dontwarn com.google.android.gms.*
-keep class android.support.v4.** { *; }

proguard 配置文件,但没有成功。我在我的应用程序中针对 android 17 (4.2.2),最小 SDK 版本是 8(我认为是 2.2)。

任何解决此错误的帮助将不胜感激。

最佳答案

确保您已经使用 Android 4.4.2 设置了您的项目并且您有“include android-support-v13.jar”。我有同样的问题,但现在已解决。

关于Android - Proguard 和 Google Play 服务的应用程序导出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25061471/

相关文章:

java - 拆分解析文本以分隔日期和时间android

parse-platform - 混淆时出现 Proguard 错误

android - Butterknife 不能在启用 Proguard 的情况下使用,使用推荐的 proguard 规则

java - 当我的数据包含0x0a和0x0d时,如何从android中的BLE读取完整长度的数据?

android - 为什么有些应用无法移动到sd卡?

android - 如何更新库 ( .aar ) 文件中的谷歌播放服务版本

android - 从 google play 下载应用程序时找不到您尝试购买的商品

android - 意外的顶级异常 Google Play 服务

android-studio - 从 Eclipse 到 Android Studio : Why is proguard. cfg 在不构建版本时使用?

android - 在不使用 ContentProvider 的情况下保留单例数据库旋转数据(Android)