带有 applicationIdSuffix 的 DexGuard

DexGuard with applicationIdSuffix

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]

表示DexGuard只能用于包名com.example.myapp,不能用于包名com.example.myapp.debug.

您可以:

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

对于第二个选项:

 buildTypes {
        release {
            proguardFile getDefaultDexGuardFile('dexguard-release.pro')
            proguardFile 'dexguard-project.txt'

            signingConfig signingConfigs.release
        }
        debug {
            //nothing
        }
    }

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