我将我的密钥库存储在我的资产目录中。如何在构建中排除它以创建.apk?
我试过这种方式,但仍然在那里:
android {
...
packagingOptions {
...
exclude 'META-INF/LICENSE.txt'
...
exclude 'assets/keystore'
}
}
它排除LICENSE.txt
但不排除keystore
答案 0 :(得分:2)
尝试下一步:
...
packagingOptions {
exclude 'META-INF/LICENSE.txt'
}
}
android.applicationVariants.all { variant ->
//if (variant.name.contains('Release')) { // exclude source and sourcemap from release builds
def rmkeystore = task("delete${variant.name}.rmkeystore", type: Delete) {
delete "${buildDir}/intermediates/assets/${variant.dirName}/keystore"
}
variant.mergeAssets.finalizedBy rmkeystore
//}
}
答案 1 :(得分:-2)