Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio keep asking for signing configuration though I already have for the release build APK

I have in my build.gradle:

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

        release {
            try {
                storeFile file("mykey.keystore")
                storePassword "store_password"
                keyAlias "myapp"
                keyPassword "key_passowrd"
               )
            }
            catch (ignored) {
                throw new InvalidUserDataException("Something wrong")
            }
        }
    }

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

        }
    }
}

In build variant, I choose "release". Then, I run my app on connected device, however, Android Studio keep popping up dialog saying:

enter image description here

But I do have signing configuration...

In build output, I don't see that app-release.apk either :

enter image description here

Why I get the error then? My Android Studio version is 3.0.1

like image 363
Leem Avatar asked Mar 06 '23 22:03

Leem


1 Answers

You forgot to provide a link to your signingConfigs:

buildTypes {
    release {
        signingConfig signingConfigs.release
        ...
    }
    debug {
        signingConfig signingConfigs.debug
        ...
    }
}
like image 152
Nikolay Kulachenko Avatar answered Mar 10 '23 11:03

Nikolay Kulachenko