question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android signing is not working

See original GitHub issue

Bug description

When I add androidKeystoreName, It seems that the android build is not using that and use some other keys for signing (The custom key store is not ticked in unity editor as the document said)

Error after uploading to google play :

[!] Google Api Error: forbidden: The Android App Bundle was signed with the wrong key. Found: SHA1: 
22:59:3D:65:70:BB:95:44:31:BB:F2:F4:7F:29:B4:4B:B4:60:5C:5A, expected: SHA1: 
E9:61:CD:E5:51:BF:84:CE:D0:2B:64:B3:36:CE:EE:B0:46:78:D6:64. - The Android App Bundle was signed with the wrong key. Found: 
SHA1: 22:59:3D:65:70:BB:95:44:31:BB:F2:F4:7F:29:B4:4B:B4:60:5C:5A, expected: SHA1: 
E9:61:CD:E5:51:BF:84:CE:D0:2B:64:B3:36:CE:EE:B0:46:78:D6:64.

I even add some wrong base64 input to see what will happen and here is some part of the logs :

2021-02-02T20:24:06.3590246Z -rw-r--r-- 1 root root   86 Feb  2 20:24 VersionGenerator.cs.meta
2021-02-02T20:24:06.3594996Z base64: invalid input
2021-02-02T20:24:06.3596071Z Created Android keystore.
2021-02-02T20:24:06.3597502Z Using custom parameters .

But even with that error, the project successfully builds with no signing error.

This is my github action:

on:
  push: { branches: [ release,feature/cicd ] }

env:
  UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

jobs:
  buildForAndroidPlatforms:
    name: Build for ${{ matrix.targetPlatform }} on version ${{ matrix.unityVersion }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        projectPath:
          - .
        unityVersion:
          - 2020.2.2f1
        targetPlatform:
          #          - iOS # Build an iOS player.
          - Android # Build an Android .apk standalone app.
    steps:
      - uses: actions/checkout@v2
        with:
          lfs: true
      - uses: actions/cache@v2
        with:
          path: Library
          key: Library-${{ matrix.targetPlatform }}
      - uses: webbertakken/unity-builder@v2.0-alpha-6
        with:
          projectPath: ${{ matrix.projectPath }}
          unityVersion: ${{ matrix.unityVersion }}
          targetPlatform: ${{ matrix.targetPlatform }}
          androidAppBundle: true
          androidKeystoreName: user.keystore
          androidKeystoreBase64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
          androidKeystorePass: ${{ secrets.ANDROID_KEYSTORE_PASS }}
          androidKeyaliasName: ${{ secrets.ANDROID_KEYALIAS_NAME }}
          androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }}
      - uses: actions/upload-artifact@v2
        with:
          name: build-${{ matrix.targetPlatform }}
          path: build/${{ matrix.targetPlatform }}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
davidmfinolcommented, Feb 3, 2021

@dopaminegamesstudio The docs are wrong. I’ll fix. Thanks for bringing this up!

2reactions
davidmfinolcommented, Feb 2, 2021

Are you using Google Play signing? If so, are you using the Upload key certificate and NOT the App signing key certificate? image Does running keytool -list -v -keystore $androidKeystoreName -alias $androidKeyaliasName match what you see for the Upload key certificate in Google Play?

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - app-release-unsigned.apk is not signed
Right click on app in left navigation pane, click Open Module Settings. · Go to Signing Tab. Add a signing config and fill...
Read more >
Sign your app
Learn important concepts related to app signing and security, how to sign your app for release to Google Play using Android Studio, and...
Read more >
Why your code signing certificate will not work for Play App ...
To see this, open Certificates in the MMC (Microsoft Management Console) and load the Certificates snap-in. After opening the certificate, ...
Read more >
Android Studio not properly signing debug release [37015573]
I am using Google APIs in my Android app so I need to have a Client Id with the SHA1 of my debug...
Read more >
Publishing AAB fails because app signing isn't enabled
Google Play app signing is not enabled for this package. You must enroll into app signing by Google Play to upload an Android...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found