【发布时间】:2016-08-02 02:37:45
【问题描述】:
我的 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
}
}
要生成 de release APK,我使用以下命令:
./gradlew assembleEnemRelease
在 Google Play 上上传生成的 APK (app-enem-release.apk) 时出现以下错误:
您上传了一个可调试的 APK。出于安全原因,您需要先禁用调试,然后才能在 Google Play 中发布它。详细了解可调试的 APK。
通过在 android Manifest android:debuggable="false" 上进行硬编码,我能够生成一个不可调试的 APK。但是构建配置仍然像可调试的构建一样,正如您在生成的 Build.config 中看到的那样(我仔细检查,这个构建配置来自发布文件夹,我也没有收到 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";
}
【问题讨论】:
-
同样的问题...
-
@Guiherme Torres Castro : 你能试着用这个ideone.com/c376gt替换你的gradle文件吗@
-
我提供链接是因为我不确定答案,但通过这种方式我解决了我的问题。
-
@dex 感谢您的提示,不幸的是它没有用