作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
一点背景。几个月来我一直在构建/调试/测试我的简单应用程序,没有任何问题。在 AVD 或我实际的 S9 手机上构建/安装。几个月来一切都很好。现在,准备好在 Play 商店中发布我的第一个 beta 版本(我的第一个应用程序)。所以,我按照“签署”我的应用程序的说明进行操作。那行得通,我将我的应用程序包上传到了 Play 商店。现在我再也无法在 Android Studio 中构建/调试/安装了。
错误:您当前选择的变体 (app-release-unsigned.apk) 的 apk 未签名。请为此变体(版本)指定签名配置。
调试 (Shift+F9) 产生上述错误并显示“编辑配置”对话框。
我点击“修复”按钮,从那里我不知道该怎么做。或者如何使用这些不同的构建配置。
构建.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'
}
单击“修复”按钮后,我将进入“运行/调试配置”对话框。从那里开始,我完全忘记了为了解决问题需要发生什么。
最佳答案
您可以通过执行以下任何操作来解决此问题
variant
来执行此操作。在搜索栏中,选择 build variant
,这将在您的 android studio 屏幕左侧显示构建变体选项,然后您应该选择名称附加了调试的变体。 build.gradle
文件apply plugin: 'com.android.application'
android {
signingConfigs {
debug {
storeFile file(var)
storePassword 'xxx'
keyAlias = 'xxx'
keyPassword 'xxx'
}
release {
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'
}
关于Android Studio 3.5.2 - 错误 : The apk for your currently selected variant (app-release-unsigned. apk) 未签名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59111920/
我是一名优秀的程序员,十分优秀!