【问题标题】:Google Drive API is not working after Proguard obfucationProguard 混淆后,Google Drive API 无法正常工作
【发布时间】:2017-06-02 13:34:19
【问题描述】:

我正在使用

compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.google.android.gms:play-services-drive:10.0.1'

在我的 Android 应用中实施 Google Drive。该应用程序运行良好,直到我使用 Proguard 混淆了该应用程序。一旦应用程序被混淆,当我尝试启用 Google Drive Backup 选项时,应用程序会弹出帐户选择对话框,之后不会继续。

在应用程序的调试版本中,当我尝试启用 Google Drive Backup 选项时,应用程序会弹出帐户选择,然后进入 Google Drive Permission 对话框以访问驱动器文件。

我读到 Google 为 Google Play 服务添加了 Proguard 规则,我想知道我的问题可能是什么。我还尝试了以下 StackOverFlow 线程中建议的 Proguard 规则

Google Drive API doesn't play well with ProGuard (NPE)

Release apk not working after enabling proguard, not able to debug too

How to fix Proguard issue with Google Drive REST API

但是,提供的解决方案对我不起作用。是否需要添加任何新规则才能使最新的 Google Drive API 正常工作?

【问题讨论】:

    标签: android google-drive-api google-drive-android-api


    【解决方案1】:

    按照here 的建议,您可以通过查看 ProGuard output files 来检查被带走的内容。同样基于此blog,这绝对是一个 Proguard 问题。还注意到其中一个调试语句表明Files 对象有一些可能导致问题的混淆字段。 快速浏览一下类文件,发现这个类有一些注释,我们在 Proguard 中看到了保留注释的引用。

    如果有帮助,您也可以查看此thread

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-12
      • 1970-01-01
      • 1970-01-01
      • 2015-08-15
      相关资源
      最近更新 更多