一些背景信息。我已经花了几个月的时间构建/调试/测试我的简单应用程序,没有任何问题。在AVD或我的实际S9手机上进行构建/安装。所有工作都非常顺利,几个月来都没有问题。现在,我准备发布我的第一个 beta 版本到 Play 商店(我历史上的第一个应用程序)。所以,我按照“签名”我的应用程序的说明进行操作。那样做了,并上传了我的应用程序包到 Play 商店。现在我无法在 Android Studio 中进行任何构建/调试/安装。
错误:您当前选择的变体的 apk(app-release-unsigned.apk)未经签名。请为此变体指定签名配置(release)。
Debug(Shift + F9)会产生以上错误并显示“编辑配置”对话框。
我点击“Fix”按钮,但是从那里我不知道该怎么做,也不知道如何使用这些不同的构建配置。
build.gradle
apply plugin: 'com.android.application'
android {
signingConfigs {
debug {
storeFile file(var)
storePassword 'xxx'
keyAlias = 'xxx'
keyPassword 'xxx'
}
}
compileSdkVersion 29
buildToolsVersion "29.0.1"
defaultConfig {
applicationId "com.birdersdiary.mobile"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "b1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.preference:preference:1.1.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
当我点击“FIX”按钮时,会跳转到“Run/Debug Configurations”对话框。但从那里开始,我完全不知道需要做什么来解决这个问题。
非常感谢任何帮助。