我的build.gradle上有以下代码:
productFlavors {
juridico {
applicationId "br.com.eit.appprovaconcursos"
}
enem {
applicationId "com.ioasys.appprova"
}
}
buildTypes {
defaultConfig {
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
testCoverageEnabled true
}
release {
debuggable false
testCoverageEnabled true
//noinspection GroovyAssignabilityCheck
signingConfig signingConfigs.release
}
}
Run Code Online (Sandbox Code Playgroud)
要生成de release APK,请使用以下命令:
./gradlew assembleEnemRelease
在app-enem-release.apkGoogle Play 上传生成的APK()时出现以下错误:
您上传了可调试的APK.出于安全原因,您需要先禁用调试,然后才能在Google Play中发布.了解有关可调试APK的更多信息.
我能够通过Android Manifest上的硬编码生成一个不可调试的APK android:debuggable="false".但是构建配置仍然像可调试构建一样,你可以在生成Build.config中看到(我仔细检查,这个构建配置来自release文件夹,我也没有收到关于Crashlytics的任何数据,我禁用它调试版本).
public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true");
public static final String APPLICATION_ID = "com.ioasys.appprova";
public static final String BUILD_TYPE = "release";
public static final String FLAVOR = "enem";
public static final int VERSION_CODE = 20135;
public static final String VERSION_NAME = "3.0.1";
}
Run Code Online (Sandbox Code Playgroud)
我发现这个奇怪的结果来自于testCoverageEnabled true.
如果您的发布版本启用了测试覆盖率,它会生成覆盖率报告,然后您的APK将成为可调试的APK.
设置testCoverageEnabled为false解决问题,并且在发布版本上不生成覆盖率报告也是有意义的.
| 归档时间: |
|
| 查看次数: |
1462 次 |
| 最近记录: |