android - 带有 applicationIdSuffix 的 DexGuard

标签 android android-gradle-plugin dexguard

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

The package name from the AndroidManifest.xml file [com.example.myapp.debug] doesn't match the package name [com.example.myapp] from your DexGuard license [path/to/dexguard-license.txt]

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

最佳答案

The package name from the AndroidManifest.xml file [com.example.myapp.debug] doesn't match the package name [com.example.myapp] from your DexGuard license [path/to/dexguard-license.txt]

这意味着您只能对包名 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
        }
    }

关于android - 带有 applicationIdSuffix 的 DexGuard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43850456/

相关文章:

Android Kotlin findViewById 不得为 null

android - 导航栏隐藏的 NestedScrollView 底部 [Android]

android - 如何在 TextInputLayout 中设置 RTL?

android - 在特定时间点在gradle中运行curl命令

android - 添加 native 代码的库后 Dexguard 崩溃

android - 使音频播放器搜索栏可点击

android - 设置并获取Android库的版本

android - Gradle :Build failed: error: resource android:attr/fontVariationSettings not found after adding api dependencies com. 微软服务

android - Dexguard 与 Maven 和 Android Studio 不工作

android - Dexguard 总是因枚举而崩溃