简体   繁体   English

保护Google Play服务7. +会导致com.google.android.gms.internal.zzig:找不到引用的方法'boolean isAttachedToWindow()'

[英]Proguarding Google Play Services 7.+ results in com.google.android.gms.internal.zzig: can't find referenced method 'boolean isAttachedToWindow()'

I have an app that is close to the 65K method count limit. 我有一个接近65K方法计数限制的应用程序。 I'm currently using Proguard without obfuscation 我目前正在使用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.**)

to strip out unused methods in its dependencies: 去除依赖项中未使用的方法:

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'

However, $ ./gradlew assemble gives the following error: 但是,$ ./gradlew汇编给出以下错误:

: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.

Has anyone troubleshooted this issue before? 有人解决过这个问题吗? Thanks in advance. 提前致谢。

确保您的compileSDK为> =19。View#isAttachedToWindow已在19中添加。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 com.google.android.gms.internal.zzhu:找不到引用的类android.security.NetworkSecurityPolicy - com.google.android.gms.internal.zzhu: can't find referenced class android.security.NetworkSecurityPolicy 找不到类'com.google.android.gms.location.internal.ParcelableGeofence',从方法glt.a引用 - Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method glt.a 找不到方法gls.a引用的类“ com.google.android.gms.location.internal.ParcelableGeofence” - Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method gls.a 找不到方法glt.a引用的类'com.google.android.gms.location.internal.ParcelableGeofence - Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence referenced from method glt.a 找不到参数[com.google.android.gms:play-services-gcm:7.5.0]的方法complie() - Could not find method complie() for arguments [com.google.android.gms:play-services-gcm:7.5.0] Android Google Play服务错误:在路径dexpathlist上找不到类com.google.android.gms.maps.mapfragment - Android Google Play Services error: didn't find class com.google.android.gms.maps.mapfragment on path dexpathlist Android:找不到方法glt.a所引用的类'com.google.android.gms.location.internal.ParcelableGeofence - Android: Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence referenced from method glt.a ProGuard:找不到引用的类com.google.android.gms.R - ProGuard: can't find referenced class com.google.android.gms.R Gradle无法管理添加编译'com.google.android.gms:play-services:7.0.0' - Gradle can't manage to add compile 'com.google.android.gms:play-services:7.0.0' Google Play服务15.0.0及更高版本中缺少com.google.android.gms.internal.measurement - com.google.android.gms.internal.measurement is missing in Google Play Services 15.0.0 and greater
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM