72

After upgrading to Android Studio Arctic Fox (2020.3.1) Canary 9. I cannot run my tests. It pops up the Edit Configurations window to show Error: The app for your currently selected variant (Unknown output) is not signed. Please specify a signing configuration for this variant (debug). message. I can't seem to solve this issue just by creating .jks and using the release signing configuration for debug variant as well like most of the posts suggested. I'm kinda stuck between whether I downgrade or try to solve it somehow. Is there anyone who faced this issue before? Any suggestions and opinions are welcomed.

enter image description here

Problem still occurs in Android Studio Arctic Fox (2020.3.1) Canary 10 version as well.

Yekta Sarıoğlu
  • 1,435
  • 2
  • 12
  • 20

9 Answers9

203

This occurred to me too, this might happen because the default signing configuration is modified after upgrading to Gradle 7.0.0. You can fix this without downgrading the Gradle. To do this,

go to File menu > Project Structure. Step Reference Image 1

then go to Modules section Step Reference Image 2

then head to Default Config tab Step Reference Image 3

Scroll down to Signing Config then click dropdown Step Reference Image 4

select $signingConfigs.debug from the drop-down list Step Reference Image 5

Click APPLY then OK then Run your app again.

That SOLVED the issue for me. Hope it works for you too.

Shivansh Goel
  • 2,031
  • 1
  • 4
  • 4
  • If you are getting the following error: `INSTALL_PARSE_FAILED_NO_CERTIFICATES` , do this: 1- Uninstall your apk 2- Clean your Android project 3- Build your Android project 4- Install / run your apk – Yago Rey Sep 09 '21 at 08:30
  • 2
    It's 2023 now but I'm still coming back to this answer because the problem is still present in Android Studio 2022.1.1. Thanks for the detailed explanation. – Mikhail Mar 07 '23 at 13:48
46

What worked for me was to add the following on the app level build.gradle (For the 'release' variant in this example):


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
       }
   }   

}
16

I was getting the same issue and came across your posts. Fortunately, I was able to fix it. Follow the step below: Build Variants (lower-left corner) > Active Build Variant > change it back to Debug

padlanau
  • 257
  • 3
  • 11
5

In app level build.gradle file add

defaultConfig{
    ...

    signingConfig signingConfigs.debug
}

inside defaultConfig block

PRANAV SINGH
  • 1,000
  • 11
  • 17
1

make sure you are not using signingConfig in app level build.grade or try with invalidate caches/restart option from file option in menu bar.

firozsaifi24
  • 41
  • 11
1

The problem occurs if Android Gradle Plugin (AGP) is higher than 7.0.0-alpha08. So downgrading to 7.0.0-alpha08 solves the problem. By doing so, you must also downgrade to Android Studio Arctic Fox (2020.3.1) Canary 8 because later versions require their corresponding AGP or the latest one. I'm not happy with the downgrade solution. But this is the only way for the tests to run at the moment.

Android Studio Archives

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Yekta Sarıoğlu
  • 1,435
  • 2
  • 12
  • 20
0

This is now fixed in the latest preview build of Android Studio (2020.3.1 Canary 15), using AGP version 7.0.0-alpha15!

0

For Kotlin dsl add this into your BuildType section:

signingConfig = signingConfigs.getByName("debug")
Abdullah Javed
  • 459
  • 3
  • 17
0

Every application need to signed with a key to install on the device. Android studio signs debug build automatically but if you want to install the release apk then you have to sign it.

So there are different way to sign the apk.

Method 1: Use debug credentials to sign the release apk as well. In app/build.gradle file you can define a variable as shown:

android {
    // ...

    defaultConfig {
        // ...
        signingConfig signingConfigs.debug
    }
}

NOTE: This will just sign your release apk with the same credential by which the debug is signed. Keep this in mind while generating the aab or apk for the distribution.

Method 2: You can also sign the release apk seperately in the app/build.gradle. You can also use the GUI as shown in the question to sign it:

android{
   // ...
   signingConfigs {
       // ...
       release {
           storeFile file("key-store-file-path")
           storePassword "key-store-password "
           keyAlias "key-alias"
           keyPassword "key-password"
       }
   }
}
Atul Sharma
  • 399
  • 3
  • 12