已成功生成已签名的 Apk,但是当我尝试运行我的项目时,出现错误 [英] Generated signed Apk successfully but when I try to Run my project, I get an error

查看:32
本文介绍了已成功生成已签名的 Apk,但是当我尝试运行我的项目时,出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了发布我的应用程序,我生成了签名 APK(我使用的是 Android Studio).已成功生成签名的 APK.对于密钥存储路径,我刚刚在 c>user>folder>name.keystore 中创建了一个文件夹.我添加了别名和密码并成功生成了签名 APK.但是,当我尝试在模拟器上运行我的应用程序时,出现以下错误:

To release my application, I generated Signed APK ( Im using Android Studio). Signed APK was generated successfully. For key store path, I just created a folder in c>user>folder>name.keystore . I added an alias and password and successfully generated Signed APK. However, when I try to run my application on the emulator, I get the following error:

app-release-unsigned.apk 未签名.请使用项目结构"对话框配置所选风格的签名信息.

app-release-unsigned.apk is not signed. Please configure the signing information for the selected flavor using the Project Structure dialog.

有没有我遗漏的一步?我做了一些谷歌搜索,发现开发人员也编辑了 gradle 文件.但是,我无法执行该步骤主要是因为它们不清楚.这是我的 build.gradle 的样子:应用插件:'com.android.application'

Is there a step i missed? I did some google search and found that developers edit gradle file too. However,I could not perform the step mostly because they were unclear. Here is what my build.gradle looks like: apply plugin: 'com.android.application'

android {
compileSdkVersion 20
buildToolsVersion "20.0.0"

defaultConfig {
    applicationId "com.app.shreyabisht.aethorr"
    minSdkVersion 15
    targetSdkVersion 20
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:support-v4:20.0.+"
}

我将构建变量更改为发布"并再次运行生成签名 APK"向导.向导成功运行,但在运行应用程序时仍然出现相同的错误.请推荐

I changed the build Variable to "release" and ran the " generate Signed APK" wizard again. The wizard ran successfully but I still get the same error when I run my application. Please suggest

推荐答案

您是否检查了您的构建变体?如果要在模拟器上运行,请确保将其设置为 debug,如果要生成 apk,请将其更改为 release.

Did you check your build variant? Make sure it's set to debug if you want to run it on the emulator, and change it to release if you want to generate an apk.

自己面对问题,并以这种方式解决了.

Faced the problem myself and solved it this way.

这篇关于已成功生成已签名的 Apk,但是当我尝试运行我的项目时,出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆