Yek*_*ğlu 6 android unit-testing android-studio android-instrumentation build-variant
升级到 Android Studio Arctic Fox (2020.3.1) Canary 9 后。我无法运行我的测试。它弹出Edit Configurations窗口以显示Error: The apk for your currently selected variant (Unknown output) is not signed. Please specify a signing configuration for this variant (debug).消息。我似乎无法通过.jks为调试变体以及大多数建议的帖子创建和使用发布签名配置来解决这个问题。我有点犹豫是降级还是尝试以某种方式解决它。有没有人以前遇到过这个问题?欢迎任何建议和意见。
Android Studio Arctic Fox (2020.3.1) Canary 10 版本同样出现问题。
小智 48
对我有用的是在应用程序级别 build.gradle 上添加以下内容(对于本示例中的“release”变体):
android{
signingConfigs {
release {
storeFile file("path to your keystore file")
storePassword "your store password "
keyAlias "your keystore alias"
keyPassword "your key password"
}
}
buildTypes {
release {
...
...
signingConfig signingConfigs.release
}
}
}
Run Code Online (Sandbox Code Playgroud)
pad*_*nau 16
我遇到了同样的问题并看到了您的帖子。幸运的是,我能够修复它。请按照以下步骤操作:Build Variants(左下角)> Active Build Variant > 将其改回 Debug
PRA*_*NGH 10
在应用程序级别的 build.gradle 文件中添加
defaultConfig{
...
signingConfig signingConfigs.debug
}
Run Code Online (Sandbox Code Playgroud)
在 defaultConfig 块内
小智 9
我也遇到过这种情况,这可能是因为升级到 Gradle 7.0.0 后修改了默认签名配置。您可以在不降级 Gradle 的情况下解决此问题。去做这个,
转到文件菜单 > 项目结构。 步骤参考图 1
然后转到模块部分 步骤参考图像2
然后前往默认配置选项卡 步骤参考图 3
向下滚动到签名配置,然后单击下拉 步骤参考图像 4
从下拉列表中 选择$signingConfigs.debug步骤参考图 5
单击应用然后确定然后再次运行您的应用程序。
那为我解决了这个问题。希望它也适用于你。
如果 Android Gradle 插件 (AGP) 高于7.0.0-alpha08. 于是降级来7.0.0-alpha08解决问题。通过这样做,您还必须降级到 Android Studio Arctic Fox (2020.3.1) Canary 8,因为更高版本需要其相应的 AGP 或最新版本。我对降级解决方案不满意。但这是目前运行测试的唯一方法。
| 归档时间: |
|
| 查看次数: |
1873 次 |
| 最近记录: |