【发布时间】:2019-04-23 20:46:43
【问题描述】:
我更新了 Android Studio,如果我没记错的话,我的项目默认包含 R8。问题是 r8 仅在默认情况下在新项目上激活,或者更新是否包括对我已经创建的项目的更改?如果没有,我该如何使用它。
【问题讨论】:
-
希望更新不会。它可能会破坏proguard。不过,您仍然可以轻松切换它
-
一切正常。但是为什么要打破 proguard 我认为 v8 正在取代它所以我希望 proguard 完全消失
-
R8 不能替代 proguard,因为 R8 是 Google 而 Proguard 是 Guardsquare。即使在不太可能发生的情况下 Google 会取消对 Proguard 的支持,Google 也与 ProGuard 无关,因此实际上无法阻止它。 ProGuard 作为标准可能会被淘汰,但不会被 R8 取代。此外,虽然 R8 具有与 ProGuard 的兼容模式,但同时运行两者可能会破坏一些东西(这就是我上次评论的意思)。此外,R8 目前needs to be enabled manually.
-
您的链接来自 2018 年,此链接在行为更改中显示“默认启用 R8”,但我是 Android 工作室的新手,我不了解它developer.android.com/studio/releases/gradle-plugin
-
For a given build type, if you set useProguard to false in your app module's build.gradle file, the Android Gradle plugin uses R8 to shrink your app's code for that build type, regardless of whether you disable R8 in your project's gradle.properties file.- 建议它不会覆盖 ProGuard。
标签: android android-studio android-r8