【问题标题】:DexGuard with applicationIdSuffix带有 applicationIdSuffix 的 DexGuard
【发布时间】:2017-05-08 14:37:16
【问题描述】:

DexGuard 最近切换到每个应用程序只有 1 个许可证的许可证系统。当我将applicationIdSuffix 用于其他构建类型时,这会导致此问题:

AndroidManifest.xml 文件中的包名 [com.example.myapp.debug] 与包名不匹配 [com.example.myapp] 来自您的 DexGuard 许可证 [路径/to/dexguard-license.txt]

是否有可用的解决方法或选项?

【问题讨论】:

    标签: android android-gradle-plugin dexguard


    【解决方案1】:

    AndroidManifest.xml 文件 [com.example.myapp.debug] 中的包名称与您的 DexGuard 许可证 [path/to/dexguard-license.txt] 中的包名称 [com.example.myapp] 不匹配

    表示你只能对包名com.example.myapp使用DexGuard,不能对包com.example.myapp.debug使用。

    你可以:

    • 为另一个包购买第二个许可证
    • 为调试构建类型禁用 DexGuard

    对于第二个选项:

     buildTypes {
            release {
                proguardFile getDefaultDexGuardFile('dexguard-release.pro')
                proguardFile 'dexguard-project.txt'
    
                signingConfig signingConfigs.release
            }
            debug {
                //nothing
            }
        }
    

    【讨论】:

    • 我们已就此向 DexGuard 背后的公司 GuardSquare 发送了邮件,他们能够在许可证中添加后缀。但我对你的第二个选项很好奇,为调试构建禁用 dexguard。这可能吗?
    • @dumazy 更新了答案。
    • 好的,关于 Fabric,我遇到了不同的问题。要将混淆文件上传到 Fabric/Crashlytics,您需要在 Fabric 插件之前应用 Dexguard 插件。但随后 Fabric 将尝试 crashlyticsStoreDeobsDebug 并崩溃,因为“在项目中找不到路径为 'dexguardDebug' 的任务”
    • 没问题。这是一个不同的问题。谢谢你的回答。
    【解决方案2】:

    因此,GuardSquare 最终更新了我们的许可证,以便我们可以使用具有相同许可证的“.debug”applicationIdSuffix。正如 Gabriele 在答案中建议的那样,您可以关闭 DexGuard 或购买第二个许可证。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-02-13
      • 2015-10-12
      • 2016-12-01
      • 2018-05-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多