[android] app-release-unsigned.apk is not signed

I downloaded the zip file of an Android app on github and I'm trying to run it, but I get a dialog with this message

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

I'm using Android Studio. What am I supposed to do?

This question is related to android github android-studio digital-signature

The answer is


signingConfigs should be before buildTypes

signingConfigs {
        debug {
            storeFile file("debug.keystore")
        }

        myConfig {
            storeFile file("other.keystore")
            storePassword "android"
            keyAlias "androidotherkey"
            keyPassword "android"
        }
    }

    buildTypes {
        bar {
            debuggable true
            jniDebugBuild true
            signingConfig signingConfigs.debug
        }
        foo {
            debuggable false
            jniDebugBuild false
            signingConfig signingConfigs.myConfig
        }
    }

i also appear this problem,and my code below

        storeFile file(properties.getProperty("filepath"))
        storePassword properties.getProperty("keypassword")
        keyAlias properties.getProperty("keyAlias")
        keyPassword properties.getProperty("keypassword")

the reason is property name error,it should be keyPassword not keypassword


adding below lines of code in build.gradel file worked for me, add them under buildTypes block below release as shown

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        applicationIdSuffix ".debug"
        debuggable true
    }

Always sign your build using your build.gradle DSL script like this:

    android {
    signingConfigs {
        debug {
            storeFile file("debug.keystore")
        }

        myConfig {
            storeFile file("other.keystore")
            storePassword "android"
            keyAlias "androidotherkey"
            keyPassword "android"
        }
    }

    buildTypes {
        bar {
            debuggable true
            jniDebugBuild true
            signingConfig signingConfigs.debug
        }
        foo {
            debuggable false
            jniDebugBuild false
            signingConfig signingConfigs.myConfig
        }
    }
}

If you want to understand a little more of the Gradle build system associated to Android Studio just pay a visit to:

Gradle Plugin User Guide


If anyone wants to debug release build using Android Studio, follow these steps:

  1. Set build variant to release mode.

enter image description here

  1. Right click on app in left navigation pane, click Open Module Settings.

  2. Go to Signing Tab. Add a signing config and fill in information. Select your keychain as well.

enter image description here

  1. Go to Build Type tab. Select release mode and set:

-Debuggable to true.

-Signing Config to the config. (The one you just created).

enter image description here

Sync your gradle. Enjoy!


Make sure the build variant is set to debug (and not release) in Android Studio (check the build variants panel).

If set to debug, it should automatically sign the app with the auto-generated debug keystore, without editing the build scripts.

However you will need to create and configure a specific keystore for release.

Official documentation, covering debug and release modes: https://developer.android.com/tools/publishing/app-signing.html


How i solved this

This error occurs because you have set your build variants to release mode. set it to build mode and run project again.

If you want to run in release mode, just generate a signed apk the way we do it normally when releasing the app


My problem was solved by changing the build variant as suggested by Stéphane , if anyone was struggling to find the "Build variants" as I did here is a screenshot where you can find it .

enter image description here


My solution was to change the name of my signing config from the default "config" to "debug". To verify, I changed it to some other random name and got the error again, and then changed it back to "debug" and the error was gone. So while it seems artificial and I tend to not believe this is the whole story, give this solution a try.


I was successfully able to debug signed APK , Follow this procedure:-

  1. Choose "release" version in "Build Variant" ToolBar
  2. In the Build.gradle for the module set debuggable true for release build type
  3. Go to File->Project Structure->under signing tab fill all info->Under Flavours tab->Choose signing Config You just created
  4. Set the breakpoints
  5. Run the application in the debug mode

In tool window bar select Build Variants Change Build Variant from Release to Debug


For gradle Kotlin dsl

signingConfigs {
    create("releaseConfig") {
        storeFile = file("your keystore file path")
        storePassword = "storePassword"
        keyAlias = "keyAlias"
        keyPassword = "keyPassword"
    }
}
buildTypes {
    getByName("release") {
        signingConfig = signingConfigs.getByName("releaseConfig")
        isMinifyEnabled = true
        isShrinkResources = true
        proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
    }
}

The app project you downloaded may include a signed info in the file of build.gradle. If you saw codes like these:

buildTypes {
    debug {
        signingConfig signingConfigs.release
    }
    release {
        signingConfig signingConfigs.release
    }
}

you could delete them and try again.


If anyone wants to debug and release separate build variant using Android Studio 3.5, follow the below steps: 1. Set build variant to release mode.

Build Variant

  1. Go to File >> Project Structure
  2. Select Modules, then Signing Config
  3. Click in the Plus icon under Signing Config

Signing Config

  1. Select release section and Provide your release App Information then Apply and OK.

signin

  1. Go to your app level build.gradle and change your buildTypes > "release" section like below Screenshot.

final

Then Run your Project. Happy Coding.


For security reasons, you cannot install an unsigned apk on Android. So if you only have the unsigned apk: you must sign it. Here is how to do that : link

Note that you can sign the apk with a self-signed certificate.

An alternative can be either :

  • to download the signed apk if available.
  • to download the sources, compile them (with Android-Studio or gradle or ...). It will produce multiple apks and one of them will be signed with your debug-key (and so you will be able to install it)

if you want to run app in debug mode

1) Look at Left Side bottom, above Favorites there is Build Variants

2) Click on Build Variants. Click on release and choose debug

it works perfect !!!


What finally worked for me, and I have no idea why, is:

  • Went to LastPass (the service I use to keep all my passwords)
  • Select my password by putting the cursor on top of the password and double clicking
  • Once selected I press cmd C to copy
  • Went to Android study and cmd V to paste

Notice I did try to copy many times by selecting the password by clicking at the end of the password and selecting the password by moving the mouse.

It is strange but it only worked by double clicking on top of the password to copy it.

Also I did use the Open Module Settings > Signing... method explained by @NightFury on this post.


Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to github

Does the target directory for a git clone have to match the repo name? Issue in installing php7.2-mcrypt How can I switch to another branch in git? How to draw checkbox or tick mark in GitHub Markdown table? How to add a new project to Github using VS Code git clone error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054 How to add empty spaces into MD markdown readme on GitHub? key_load_public: invalid format git - remote add origin vs remote set-url origin Cloning specific branch

Examples related to android-studio

A failure occurred while executing com.android.build.gradle.internal.tasks "Failed to install the following Android SDK packages as some licences have not been accepted" error Android Gradle 5.0 Update:Cause: org.jetbrains.plugins.gradle.tooling.util This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()' Flutter plugin not installed error;. When running flutter doctor ADB.exe is obsolete and has serious performance problems Android design support library for API 28 (P) not working Flutter command not found How to find the path of Flutter SDK

Examples related to digital-signature

app-release-unsigned.apk is not signed How do I find out which keystore was used to sign an app? HMAC-SHA256 Algorithm for signature calculation Using SHA1 and RSA with java.security.Signature vs. MessageDigest and Cipher