shrbisht
shrbisht

Reputation: 676

Generated signed Apk successfully but when I try to Run my project, I get an error

added the errorTo 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 is not signed. Please configure the signing information for the selected flavor using the Project Structure dialog.

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.+"
}

EDIT: 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

Upvotes: 1

Views: 2413

Answers (2)

yash.cr7
yash.cr7

Reputation: 70

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.

Upvotes: 1

Chris
Chris

Reputation: 4593

You are using the wrong APK. Use the APK file at the root of your project folder for example:

app -> app.apk

Do not use the APK inside build -> outputs

If this doesn't resolve your problem (the build script might affect this, see http://developer.android.com/sdk/installing/studio-build.html) you can generate the signed APK and presuming you are using Android Studio (not sure about eclipse), once it is finished it should present you with a success dialog. This dialog should have an option for something like "Show In Folder". Select this option to view the signed APK you have just built in its relevant location.

Upvotes: 0

Related Questions