Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem signing aap #39

Open
mindaugasnakrosis opened this issue May 9, 2021 · 7 comments
Open

Problem signing aap #39

mindaugasnakrosis opened this issue May 9, 2021 · 7 comments

Comments

@mindaugasnakrosis
Copy link

mindaugasnakrosis commented May 9, 2021

I get an error in my github actions:

Preparing to sign key @ android/app/build/outputs/bundle/release with signing key
/usr/bin/jarsigner -keystore android/app/build/outputs/bundle/release/signingKey.jks -storepass *** -keypass *** android/app/build/outputs/bundle/release/app-release.aab ***
jarsigner: unable to sign jar: java.util.zip.ZipException: invalid entry compressed size (expected 54105 but got 55476 bytes)

I found this answer:

https://stackoverflow.com/questions/5089042/jarsigner-unable-to-sign-jar-java-util-zip-zipexception-invalid-entry-compres

But it does not make any sense to me. How can it be already signed?

I found related issue: #31

however, it does not say how to solve the issue (at least I did not understand the solution)

My configuration file:

on: workflow_dispatch

name: Release to Google Play Store

jobs:
  beta-distribution:
    runs-on: ubuntu-latest
    name: Beta Distribution
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - uses: actions/setup-node@master
    - uses: c-hive/gha-yarn-cache@v1

    - name: Install node modules
      run: |
        yarn install
    - name: Cache Gradle Wrapper
      uses: actions/cache@v2
      with:
        path: ~/.gradle/wrapper
        key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}

    - name: Cache Gradle Dependencies
      uses: actions/cache@v2
      with:
        path: ~/.gradle/caches
        key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
        restore-keys: |
          ${{ runner.os }}-gradle-caches-
    - name: Make Gradlew Executable
      run: cd android && chmod +x ./gradlew

    - name: Build Android App Bundle
      run: |
        cd android && ./gradlew bundleRelease --no-daemon
    - name: Sign App Bundle
      id: sign_app
      uses: r0adkll/sign-android-release@v1
      with:
        releaseDirectory: android/app/build/outputs/bundle/release
        signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }}
        alias: ${{ secrets.ANDROID_SIGNING_ALIAS }}
        keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }}
        keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }}

    - name: Upload Artifact
      uses: actions/upload-artifact@v2
      with:
        name: Signed App Bundle
        path: ${{steps.sign_app.outputs.signedReleaseFile}}

    - name: Deploy to Play Store (BETA)
      uses: r0adkll/upload-google-play@v1
      with:
        serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT }}
        packageName: com.wmsappbare
        releaseFile: a${{steps.sign_app.outputs.signedReleaseFile}}
        track: beta
        inAppUpdatePriority: 3
        userFraction: 0.5
        whatsNewDirectory: android/release-notes/
        # mappingFile: android/app/build/outputs/mapping/release/mapping.txt

@r0adkll might you give me some leads how to debug this issue?

@ArshanKhanifar
Copy link

+1 having the same issue here.

@mindaugasnakrosis
Copy link
Author

mindaugasnakrosis commented May 19, 2021

@ArshanKhanifar posted a stackoverflow question here: https://stackoverflow.com/questions/67604963/unable-to-sign-jar-invalid-entry-compressed-size

@ArshanKhanifar
Copy link

I realized my problem was that I was actually building a bundle instead of an APK. So I changed my releaseDirectory to: releaseDirectory: android/app/build/outputs/apk/release and also invoked ./gradlew with assembleRelease.

This fixed it for me. Here is my job file:

      - name: Build Android App Bundle
        run: |
          cd android && ./gradlew assembleRelease --no-daemon

      - name: Sign App Bundle
        id: sign_app
        uses: r0adkll/sign-android-release@v1
        with:
          releaseDirectory: android/app/build/outputs/apk/release
          signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }}
          alias: ${{ secrets.ANDROID_SIGNING_ALIAS }}
          keyStorePassword: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }}
          keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }}

@ArshanKhanifar
Copy link

@mindaugasnakrosis Sorry I don't know about app bundles just yet so don't have anything to add to ur stackoverflow question for now.

I remember when I was making the key, there were two different ways to sign the app:
image

Make sure you did this by selecting the Android App Bundle option, not the APK option.

You can access this by: Build > Build Bundle(s) / APK(s)
image

@atiernan
Copy link

I ran in to this issue, the fix was to remove the signingConfig signingConfigs.debugline from within buildTypes -> release in build.gradle

@rsi2m
Copy link

rsi2m commented Oct 21, 2021

I ran in to this issue, the fix was to remove the signingConfig signingConfigs.debugline from within buildTypes -> release in build.gradle

Yeah, this fix helped me as well! Thanks!

@dhavallogistic
Copy link

I ran in to this issue, the fix was to remove the signingConfig signingConfigs.debugline from within buildTypes -> release in build.gradle

Yes worked like Gem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants