【发布时间】:2015-08-07 07:27:52
【问题描述】:
我最近将 proguard 添加到一个使用 Google Play 服务和支持 V4 最新版本库的大型项目中。
我没有在 proguard 配置文件中添加任何关于这些库的内容,我只是添加了这个:
-ignorewarnings
-dontobfuscate
现在我注意到在 proguard 输出文件 usage.txt(您可以在其中看到 proguard 删除的所有代码)中有很多来自 google play services 和 android support v4 的代码。
我检查了官方文档,如果您使用 proguard,我没有发现任何关于为 Support v4 和 google play 服务添加例外的信息,我刚刚发现:
注意:ProGuard 指令包含在 Play 服务客户端中 库以保留所需的类。 Android 插件 Gradle 自动在 AAR 中附加 ProGuard 配置文件 (Android ARchive) 打包并将该包附加到您的 ProGuard 配置。在项目创建过程中,Android Studio 会自动 创建 ProGuard 配置文件和 build.gradle 属性 供 ProGuard 使用。要将 ProGuard 与 Android Studio 一起使用,您必须启用 build.gradle buildTypes 中的 ProGuard 设置。更多 信息,请参阅 ProGuard 指南。
但问题是我没有使用 Android Studio 进行编译,我使用 ant 和 eclipse 从命令行编译,我没有使用 gradle,所以我不确定是否必须在 proguard 配置文件中添加一些内容和我在官方文档中找不到任何关于此的内容。
如果我不在这些库的 proguard 配置中添加一些东西,我将来会遇到问题吗?
【问题讨论】:
标签: android google-play-services proguard android-proguard