浏览Google Play服务7. +结果com.google.android.gms.internal.zzig:找不到引用的方法'boolean isAttachedToWindow()'

时间:2015-06-03 18:40:33

标签: android google-play-services proguard android-proguard

我的应用程序接近65K方法计数限制。我目前正在使用没有混淆的Proguard

# This is a configuration (rules) file for ProGuard.
-dontobfuscate
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers

# Dex does not like code run through the ProGuard optimize and preverify steps
# (and performs some of these optimizations on its own).
-dontpreverify
-dontoptimize
-verbose

# Only run ProGuard shrinking against Google Play Services (package = com.google.android.gms.*)
-keep class !com.google.** (also tried !com.google.android.** / !com.google.android.gms.**)
-dontwarn !com.google.** (also tried !com.google.android.** / !com.google.android.gms.**)

删除其依赖项中未使用的方法:

compile 'com.google.android.gms:play-services-base:7.5.0'
compile 'com.google.android.gms:play-services-location:7.5.0'
compile 'com.google.android.gms:play-services-ads:7.5.0'
compile 'com.google.android.gms:play-services-gcm:7.5.0'
compile 'com.google.android.gms:play-services-identity:7.5.0'

但是,$ ./gradlew assemble会出现以下错误:

:proguardGoogleDebug
Warning: com.google.android.gms.internal.zzig: can't find referenced method 'boolean isAttachedToWindow()' in program class com.google.android.gms.internal.zzig
Warning: there were 1 unresolved references to program class members.
         Your input classes appear to be inconsistent.
         You may need to recompile the code.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)
:proguardGoogleDebug FAILED
FAILURE: Build failed with an exception.

之前是否有人对此问题进行了问题排查?提前谢谢。

1 个答案:

答案 0 :(得分:1)

确保您的compileSDK是> = 19.查看#isAttachedToWindow已添加到19。