【发布时间】:2019-11-15 19:18:49
【问题描述】:
我有一个具有多种风格的应用程序,我正在使用 dexguard,我决定在 Jenkins 上设置它。 Dexguard 许可证位于 /app/flavor/ 以获取 eash 许可证,但 Jenkins 总是从最后一个风味中获取许可证。 构建失败并显示错误代码:
AndroidManifest.xml 文件 [com.example.android.flavor1.something] 中的包名与包名 [com.example.android.flavor6.something,com.example.android.flavor6.test] 不匹配,com.example.android.flavor6.something.prod,com.example.android.flavor6.test] 来自您的 DexGuard 许可证 [C:\Users\CurrentUser\AndroidStudioProjects\MyApp\flavor6\dexguard-license.txt]
我尝试将 dexguard.license 重命名为 dexguard-licenseX.txt(其中 X 是风味的数量)并在风味 build.gradle 中设置以查找该名称,甚至找不到许可证文件。
我还尝试使用systemProp.dexguard.licence=./flavor1 在 gradle.properties 中设置许可证位置。
我正在使用
release {
System.properties['dexguard.license'] = buildscript.sourceFile.parent
proguardFiles getDefaultDexGuardFile('dexguard-release.pro'), 'dexguard-rules.pro', 'proguard-rules.pro'
}
这只有在我尝试构建最后一种风格时才有效,否则我必须将 dexguard-license 复制到主文件夹(这在本地不是问题,但在 Jenkins 上是一个问题)。
有没有办法在 jenkins 上设置 dexguard ?
【问题讨论】:
标签: android jenkins gradle dexguard