【问题标题】:Where is the output of ProGuard's -whyareyoukeeping in Android Studio?ProGuard 的 -whyareyoukeeping 在 Android Studio 中的输出在哪里?
【发布时间】:2015-12-14 11:31:02
【问题描述】:

我在 Android Studio 的应用程序的 gradle 设置中使用 ProGuard。在“Gradle Console”窗口中,我可以读取来自 proGuard 的警告。但是,当我使用whyareyoukeeping 时,那里没有显示任何内容。我错过了什么吗?

这是我尝试使用它的一个示例:

-whyareyoukeeping class com.google.android.gms.internal.zzel

【问题讨论】:

    标签: android android-studio android-gradle-plugin proguard


    【解决方案1】:

    我想如果我在 Gradle 的命令行选项中添加“--info”标志,那么 ProGuard 的所有输出都会显示在 Gradle 控制台中。

    【讨论】:

      【解决方案2】:

      仅作记录:

      例如,添加以下选项:

      -whyareyoukeeping class **.MyApplication

      然后打开 Gradle 控制台选项卡(在右侧下方)并运行“构建”>“构建 SDK”。在构建过程中,您会看到(或稍后可以查找)打印出来的这些行:

      Shrinking...
      Explaining why classes and class members are being kept...
      
      your.package.name.MyApplication
        is kept by a directive in the configuration.
      

      如果您没有找到这些行,也许您应该将 --info 添加到 Gradle 控制台命令行选项中,如 Petrakeas 指定的那样,重新启动 Android Studio 并重试。

      【讨论】:

      • 很高兴它没有打印出哪个指令是原因。在数百行 proguard conf 中很容易找到原因
      【解决方案3】:

      您必须在“消息”面板的过滤器中选中“通用”。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-10-20
        • 2017-04-04
        • 2014-11-01
        • 2013-06-02
        • 2020-12-31
        • 1970-01-01
        • 2022-12-26
        • 2013-05-14
        相关资源
        最近更新 更多