我刚刚将我的 Android Studio 从 1.5 升级到 2.2,现在在运行我的应用程序时出现错误:
Installation failed since the APK was either not signed, or signed incorrectly. If this is a Gradle-based project, then make sure the signing configuration is specified in the Gradle build script.
我已经用谷歌搜索了,但没有任何效果,我的 gradle 文件是:
...
android {
signingConfigs {
myapp_signed {
keyAlias 'mkey'
keyPassword 'pwd'
storeFile file('.../_keystore.jks')
storePassword 'pwd'
}
}
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId '...'
minSdkVersion 14
targetSdkVersion 22
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.myapp_signed
}
}
productFlavors {
}
}
...
有人知道怎么解决吗?就在我收到这个错误之前,我收到了另一个错误,它说:
Warning:Gradle version 2.10 is required. Current version is 2.2. If using the gradle wrapper, try editing the distributionUrl in C:\Users\blahblah\myproject\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip
我是这样解决的"Gradle Version 2.10 is required." Error
编辑: 即使我将构建变体切换回调试,卸载应用程序并重试,我也会遇到同样的错误。
最佳答案
对我来说,解决方案是更新我使用的所有库并更新到 Android 23。 也许这对某人有帮助。
关于android - 安装失败,因为 APK 未签名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37352638/