安卓与谷歌驱动器SDK集成不混淆建设工作? [英] Android: Integration with google drive sdk doesn't work in obfuscated build?
问题描述
我的应用程序与谷歌的驱动器集成SDK。它的工作原理,从日食时运行如预期,但与ProGuard混淆构建,我得到下面的错误。该proguarded建立与不同的密钥库比日食一(与调试密钥库签署)签署。在我的谷歌API控制台我创建2的客户端ID,每个从每个密钥库的SHA1。
很可能是某些问题的ProGuard造成的?任何其他建议?
15 03-29:08:50.845:E /错误(24742):com.google.a.a.b.b.c:403禁止
03-29 15:08:50.845:E /错误(24742):{
03-29 15:08:50.845:E /错误(24742):code:403,
03-29 15:08:50.845:E /错误(24742):错误:
03-29 15:08:50.845:E /错误(24742):{
03-29 15:08:50.845:E /错误(24742):域:usageLimits
03-29 15:08:50.845:E /错误(24742):消息:访问未配置,
03-29 15:08:50.845:E /错误(24742):理由:accessNotConfigured
03-29 15:08:50.845:E /错误(24742):}
03-29 15:08:50.845:E /错误(24742):]
03-29 15:08:50.845:E /错误(24742):消息:访问未配置
03-29 15:08:50.845:E /错误(24742):}
03-29 15:08:50.845:E /错误(24742):在com.google.a.a.b.d.a.c.b(来源不明)
这是固定的,加入下面我ProGuard的配置,在下面的链接找到。鉴于此错误信息,这是令人惊讶的,这是一个模糊的问题。
-keep类com.google **。{*;}
。-keep接口com.google ** {*;}
-dontwarn com.google。**-dontwarn sun.misc.Unsafe
-dontwarn com.google.common.collect.MinMaxPriorityQueue
-keepattributes *注释*,签名
-keep类*宽com.google.api.client.json.GenericJson {
*;
}
-keep类com.google.api.services.drive。** {
*;
}
<一个href=\"http://stackoverflow.com/questions/14410520/google-drive-api-doesnt-play-well-with-proguard-npe\">Google驱动器API不使用ProGuard发挥好(NPE)
My app integrates with the google drive sdk. It works as expected when running from eclipse, but with a build obfuscated with proguard, I get the below error. The proguarded build is signed with a different keystore than the one from eclipse (which is signed with the debug keystore). In my Google Apis Console I created 2 client IDs, each with the SHA1 from each keystore.
Is likely to be caused by some issue with proguard? Any other suggestions?
03-29 15:08:50.845: E/error(24742): com.google.a.a.b.b.c: 403 Forbidden
03-29 15:08:50.845: E/error(24742): {
03-29 15:08:50.845: E/error(24742): "code": 403,
03-29 15:08:50.845: E/error(24742): "errors": [
03-29 15:08:50.845: E/error(24742): {
03-29 15:08:50.845: E/error(24742): "domain": "usageLimits",
03-29 15:08:50.845: E/error(24742): "message": "Access Not Configured",
03-29 15:08:50.845: E/error(24742): "reason": "accessNotConfigured"
03-29 15:08:50.845: E/error(24742): }
03-29 15:08:50.845: E/error(24742): ],
03-29 15:08:50.845: E/error(24742): "message": "Access Not Configured"
03-29 15:08:50.845: E/error(24742): }
03-29 15:08:50.845: E/error(24742): at com.google.a.a.b.d.a.c.b(Unknown Source)
This was fixed by adding the below to my proguard config, found in the following link. Given the error message, it was surprising this was an obfuscation issue.
-keep class com.google.** { *;}
-keep interface com.google.** { *;}
-dontwarn com.google.**
-dontwarn sun.misc.Unsafe
-dontwarn com.google.common.collect.MinMaxPriorityQueue
-keepattributes *Annotation*,Signature
-keep class * extends com.google.api.client.json.GenericJson {
*;
}
-keep class com.google.api.services.drive.** {
*;
}
Google Drive API doesn't play well with ProGuard (NPE)
这篇关于安卓与谷歌驱动器SDK集成不混淆建设工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!