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

**URL:** <https://discuss.bitrise.io/t/android-sign-apk-step-error-unsupported-protocol-scheme-fail-using-existing-release-keystore-file/5727>\
**Category:** Tooling Issues\
**Tags:** step, code-signing, android\
**Created:** [July 24, 2018, 2:31pm UTC](https://discuss.bitrise.io/t/android-sign-apk-step-error-unsupported-protocol-scheme-fail-using-existing-release-keystore-file/5727 "2018-07-24T14:31:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![friederikewild](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/friederikewild/32/1645_2.png) [@friederikewild](https://discuss.bitrise.io/u/friederikewild)\
**Post date:** [July 24, 2018, 2:31pm UTC](https://discuss.bitrise.io/t/android-sign-apk-step-error-unsupported-protocol-scheme-fail-using-existing-release-keystore-file/5727/1 "2018-07-24T14:31:15Z")

</div>

Looking for help to use Bitrise to build signed installable builds.

I’ve read through all the docs and followed those along ([Upload and download keystore file](https://devcenter.bitrise.io/code-signing/android-code-signing/android-code-signing-using-bitrise-sign-apk-step/)).

I failed to get the updated special configs as [explained here](https://devcenter.bitrise.io/code-signing/android-code-signing/android-code-signing-in-gradle/) working, but I think using the `sign-apk step` feels more elegant anyway. I feel like getting very close. But now it is complaining about my file not being valid.

**Here is where I am:**

I created a special “ci” Android buildType in `gradle` that doesn’t include any `signingConfig`:

```
android {
    buildTypes {
        // Mimic release settings. TODO: Enable minifyEnabled to run proguard once ci is setup
        ci {
            zipAlignEnabled true
            minifyEnabled false
            // No signingConfig. Let ci do sign step
        }

```

**This is the error output on running, all steps before are ok:**

```
Configs:
 - ApkPath: /bitrise/deploy/app-mock-ci-unsigned.apk
 - KeystoreURL: ***
 - KeystorePassword: ***
 - KeystoreAlias: ***
 - PrivateKeyPassword: ***
 - JarsignerOptions: 
Download keystore
Failed to download keystore, error: [Get /root/keystores/pvlse_release.keystore: unsupported protocol scheme ""]
| |
+---+---------------------------------------------------------------+----------+
| x | sign-apk@1.2.2 (exit code: 1) | 2.55 sec |

```

I’ve uploaded the keystore file to the Android keystore file section in the **Code Signing tab**. I had this release key for years and it doesn’t have a “jks” ending as in the docs, but a “.keystore” one. When reading the properties with the `keytool` command I do get that it is a `jks` keystore:

`Keystore type: JKS`

I so far could not find an answer how or if I need to convert the `.keystore` file to a `.jks` one. Maybe that would be a solution if such a conversion is possible?

Here is my **bitrise workflow config** showing the steps I’ve set up to run unit tests & build release using `assembleCi`:

```
deploy:
    steps:
    - activate-ssh-key@4.0.2:
        run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
    - git-clone@4.0.11: {}
    - cache-pull@2.0.1: {}
    - install-missing-android-tools@2.2.0: {}
    - gradle-unit-test@1.0.5:
        inputs:
        - unit_test_task: testCiUnitTest
    - file-downloader@1.0.1:
        inputs:
        - destination: '"$HOME/keystores/project_release.keystore"'
        - source: "$BITRISEIO_ANDROID_KEYSTORE_URL"
    - gradle-runner@1.8.3:
        inputs:
        - gradle_file: "$GRADLE_BUILD_FILE_PATH"
        - gradle_task: assembleCi
        - gradlew_path: "$GRADLEW_PATH"
    - sign-apk@1.2.2:
        inputs:
        - keystore_url: "$HOME/keystores/project_release.keystore"
    - deploy-to-bitrise-io@1.3.12:
        inputs:
        - notify_user_groups: none
    - cache-push@2.0.5: {}

```

Any input and help welcome. Thanks very much in advance!  
Friederike

---

<div class="post-metadata">

**Author:** ![friederikewild](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/friederikewild/32/1645_2.png) [@friederikewild](https://discuss.bitrise.io/u/friederikewild)\
**Post date:** [July 24, 2018, 5:20pm UTC](https://discuss.bitrise.io/t/android-sign-apk-step-error-unsupported-protocol-scheme-fail-using-existing-release-keystore-file/5727/2 "2018-07-24T17:20:26Z")

</div>

Searching through the forum history, I found this old question by @danielwilson1702  
1 that sounds similar and didn’t end in a confirmed solution? But maybe it really was different.

> [@Can't create a release apk with keystore file](http://discuss.bitrise.io/t/cant-create-a-release-apk-with-keystore-file/4086/4):
>
> 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 [http://devcenter.bitrise.io/android/code-signing/#1-specify-code-sign-configuration-in-your-project](http://devcenter.bitrise.io/android/code-signing/#1-specify-code-sign-configuration-in-your-project) )? 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. [https://github.com/bitrise-samples/sample-apps-an…](https://github.com/bitrise-samples/sample-apps-android-sdk22/blob/master/app/build.gradle)

---

<div class="post-metadata">

**Author:** ![koral](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/koral/32/357_2.png) [@koral](https://discuss.bitrise.io/u/koral)\
**Post date:** [July 24, 2018, 6:26pm UTC](https://discuss.bitrise.io/t/android-sign-apk-step-error-unsupported-protocol-scheme-fail-using-existing-release-keystore-file/5727/3 "2018-07-24T18:26:57Z")

</div>

You need to pass a URL, not a path.  
So you should use input like this:  
`keystore_url: "file://$HOME/keystores/project_release.keystore"`

See also example in the docs:

> <https://github.com/bitrise-steplib/steps-sign-apk/blob/master/step.yml#L52>

---

<div class="post-metadata">

**Author:** ![friederikewild](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/friederikewild/32/1645_2.png) [@friederikewild](https://discuss.bitrise.io/u/friederikewild)\
**Post date:** [July 25, 2018, 8:05am UTC](https://discuss.bitrise.io/t/android-sign-apk-step-error-unsupported-protocol-scheme-fail-using-existing-release-keystore-file/5727/4 "2018-07-25T08:05:49Z")

</div>

> [@koral](#):
>
> You need to pass a URL, not a path.  
> So you should use input like this:  
> `keystore_url: "file://$HOME/keystores/project_release.keystore"`

@koral Thanks for your help! I got it to work. I missed that among all the documentation places.  
I think it only works without the `"`, I first included it as you wrote it, but that lead to the following error:

> Failed to download keystore, error: [parse “file:///root/keystores/pvlse\_release.keystore”: first path segment in URL cannot contain colon]

Would be great to have an example sign-step config added to [Android code signing using the Android Sign Step - Bitrise Docs](https://devcenter.bitrise.io/code-signing/android-code-signing/android-code-signing-using-bitrise-sign-apk-step/)

Using the name from the already available snippet:

```
- file-downloader:
   inputs:
   - source: $BITRISEIO_ANDROID_KEYSTORE_URL
   - destination: "$HOME/keystores/my_keystore.jks"

```

The additional info would just need to be:

```
- sign-apk:
   inputs:
   - keystore_url: file://$HOME/keystores/my_keystore.jks

```

---

<div class="post-metadata">

**Author:** ![bitce](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/bitce/32/1639_2.png) [@bitce](https://discuss.bitrise.io/u/bitce)\
**Post date:** [July 25, 2018, 10:29am UTC](https://discuss.bitrise.io/t/android-sign-apk-step-error-unsupported-protocol-scheme-fail-using-existing-release-keystore-file/5727/5 "2018-07-25T10:29:06Z")

</div>

Thanks for helping out @koral! 😉

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)\
**Post date:** [August 24, 2018, 10:29am UTC](https://discuss.bitrise.io/t/android-sign-apk-step-error-unsupported-protocol-scheme-fail-using-existing-release-keystore-file/5727/6 "2018-08-24T10:29:06Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
