Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 3.5.2 - Error: The apk for your currently selected variant (app-release-unsigned.apk) is not signed

A little background. I have been building/debugging/testing my simple App for a few months with no problems. Build/install on AVD or my actual S9 phone. All worked just fine for months. Now, ready for my first beta release to the Play Store (my first app ever). So, I followed instructions on 'signing' my app. That worked and I uploaded my app bundle to the Play Store. Now I can't build/debug/install at all in Android Studio anymore.

Error: The apk for your currently selected variant (app-release-unsigned.apk) is not signed. Please specify a signing configuration for this variant (release).

enter image description here

Debug (Shift+F9) produces the above error and shows the "Edit configuration" dialog.

enter image description here

I click on the "Fix" button and from there I have no idea what to do. Or how to use these different build configurations.

enter image description here

build.gradle

apply plugin: 'com.android.application'

android {
    signingConfigs {
        debug {
            storeFile file(var)
            storePassword 'xxx'
            keyAlias = 'xxx'
            keyPassword 'xxx'
        }
    }
    compileSdkVersion 29
    buildToolsVersion "29.0.1"
    defaultConfig {
        applicationId "com.birdersdiary.mobile"
        minSdkVersion 15
        targetSdkVersion 29
        versionCode 1
        versionName "b1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.preference:preference:1.1.0'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

Once I click on the "FIX" button I am taken to the "Run/Debug Configurations" dialog. And from there it is completely oblivious to me what needs to happen in order to Fix the problem.

Any assistance greatly appreciated.

like image 924
JJJones_3860 Avatar asked Nov 29 '19 23:11

JJJones_3860


People also ask

What is signed and unsigned APK in Android?

A Keystore is basically a binary file that contains a set of private keys. Every App that we install using the Google Play App Store needs to be signed with a Keystore. The signed apk is simply the unsigned apk that has been signed via the JDK jarsigner tool.

Can unsigned APK be installed?

Apps that are not listed in the Google Play app store are called Unsigned Android Apps. If you need to install such an app for your Android device, you can still do so, but you'll need to enable settings inside Android that enable you to install unsigned third-party apps.

Where is the APK generated in Android Studio?

Step 1: After building a project/application that you want to import into an APK file go to Build > Build Bundle(s)/APK(s) > Build APK(s) from the toolbar menu. Output: Android Studio will take a few minutes to generate the APK file.


1 Answers

You should se the singing config after defining it. Though I guess name it something other than debug if you're going to use it for release:

buildTypes {
        release {
           minifyEnabled false
           proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

           signingConfig signingConfigs.debug
        }
    }
like image 134
Rick Sanchez Avatar answered Oct 02 '22 15:10

Rick Sanchez