Can't create a release apk with keystore file



Hi guys, I cannot for the life of me figure out how to do a release build because I’m useless at this CI stuff. I’ve read your doc on code signing at least 5 times now :smiley: .

I wanted to go for option 2 because I’d rather not have to touch my gradle file. So I uploaded the keystore to BitRise, set the password etc, changed the default Gradle Runner to assembleRelease, and added a sign-apk workflow step after the gradle runner.
I get an error telling me it can’t find a keystore so the build fails. What do you think I’m doing wrong here?

I then tried option 1 and modified my build.gradle with a new signing config:

        v2SigningEnabled false
        keyAlias System.getenv("BITRISEIO_ANDROID_KEYSTORE_ALIAS")
        storeFile file(System.getenv("BITRISEIO_ANDROID_KEYSTORE_URL"))
        storePassword System.getenv("BITRISEIO_ANDROID_KEYSTORE_PASSWORD")

That didn’t work either, it can’t find the keystore:
annot convert URL '<‘ - <snip>’ to a file.

Cannot sign the apk

Na’, first steps are always hard but you’ll get into it in no time, don’t worry! :wink:

I’d suggest as well if you’re getting started.

Sounds good :slight_smile:

I’d suggest you to revert that change, it’s not required if you go with option 2. Let’s stick with Option 2, using the Sign APK step :wink:

Could you please copy paste the related build’s URL? Sounds like a minor misconfiguration - with the URL I can check the logs & the config the build ran with :wink:


Thanks Viktor! Here is the most recent build. Correct me if I’m wrong but does the gradle task assembleRelease not just attempt to create a signed apk in one step (using whatever environment variables are in the gradle)? In which case I need to create an unsigned apk first I guess and somehow pass it to the sign-apk task.

If it makes any difference my assemble task is actually a build variant: assembleRelease_slim, but I don’t think that matters.


From the log of the build:

Caused by: java.lang.IllegalArgumentException: Keystore file not set for signing config release

Are you sure that you reverted the build.gradle changes (the ones mentioned here )? It seems your build.gradle is still configured to use a keystore file.

I’d suggest you to remove the signingConfigs section from there (e.g.; that should allow gradle to generate an unsigned release APK, which then can be signed by the Sign APK step.

Let me know how it goes or if you’d have any questions! :wink:

[Android] Sign APK Step Error: unsupported protocol scheme "". Fail using existing release .keystore file

Hey there, I struggled with this for a while and realized that it was due to a missing build.gradle configuration:

// make sure you include signingConfigs above the buildTypes block
signingConfigs {
    release {
        keyAlias System.getenv("BITRISEIO_ANDROID_KEYSTORE_ALIAS")
        storeFile file(System.getenv("HOME") + "/keystores/bcs.jks")
        storePassword System.getenv("BITRISEIO_ANDROID_KEYSTORE_PASSWORD")

//include signingConfig.release in your release buildType configuration. 
buildTypes {
    debug {
    release {
        signingConfig signingConfigs.release

Perhaps a rookie mistake, but could be a good idea to cover this in the documentation.