Gradle-play-publisher: 403 Forbidden - The Android App Bundle was not signed. Please sign the bundle using jarsigner.

Created on 11 Apr 2020  路  3Comments  路  Source: Triple-T/gradle-play-publisher

Describe the bug

Gradle : 6.2
Play publisher - 2.8.0

When running gradlew publishBundle

I get the following error:

> Task :app:publishReleaseBundle
Starting App Bundle upload: C:\Users\Elira\WebstormProjects\pokemotionv2\android\app\build\outputs\bundle\release\app-release.aab
Uploading App Bundle: 23% complete
Uploading App Bundle: 46% complete
Uploading App Bundle: 69% complete
Uploading App Bundle: 92% complete

> Task :app:publishReleaseBundle FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:publishReleaseBundle'.
> A failure occurred while executing com.github.triplet.gradle.play.tasks.PublishBundle$BundleUploader
   > 403 Forbidden
     {
       "code" : 403,
       "errors" : [ {
         "domain" : "androidpublisher",
         "message" : "The Android App Bundle was not signed. Please sign the bundle using jarsigner.",
         "reason" : "apkNotificationMessageKeyBundleUnsigned"
       } ],
       "message" : "The Android App Bundle was not signed. Please sign the bundle using jarsigner."
     }

My build.gradle file:

apply plugin: 'com.android.application'
apply plugin: 'com.github.triplet.play'

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    defaultConfig {
        applicationId "myapp"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 10101
        versionName "2.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    signingConfigs {
        config {
            keyAlias "mykey"
            keyPassword "mypas"
            storeFile file("mykeystore.keystore")
            storePassword "mypass"
        }
    }
}

play {
    serviceAccountCredentials = file("api.json")
    track = 'internal' //'alpha','beta' or 'production'
}

repositories {
    flatDir{
        dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
    implementation project(':capacitor-android')
    testImplementation "junit:junit:$junitVersion"
    androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
    androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
    implementation project(':capacitor-cordova-android-plugins')
}

apply from: 'capacitor.build.gradle'

try {
    def servicesJSON = file('google-services.json')
    if (servicesJSON.text) {
        apply plugin: 'com.google.gms.google-services'
    }
} catch(Exception e) {
    logger.warn("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}

"Generate SIgned Bundle" - working from Android studio. also the upload.

Expected behavior

The signing should work

Why I get "The Android App Bundle was not signed. Please sign the bundle using jarsigner" error when the signing config is correct and I can sign and build release bundle from Android Studio and not while using GPP?

bug

Most helpful comment

@tonyshkurenko yes, i did. if you have your signing config block:

signingConfigs {
        release {
            storeFile file('####')
            keyAlias '####''
            keyPassword '####''
            storePassword '####'
        }
    }

make sure to include it in your buildTypes:

 buildTypes {
        release {
        signingConfig signingConfigs.release
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

All inside android

All 3 comments

@theunreal how did you resolve this?

@nightcrawler- did you?

@tonyshkurenko yes, i did. if you have your signing config block:

signingConfigs {
        release {
            storeFile file('####')
            keyAlias '####''
            keyPassword '####''
            storePassword '####'
        }
    }

make sure to include it in your buildTypes:

 buildTypes {
        release {
        signingConfig signingConfigs.release
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

All inside android

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MaTriXy picture MaTriXy  路  4Comments

daniele-pecora picture daniele-pecora  路  5Comments

emartynov picture emartynov  路  4Comments

kristiyanP picture kristiyanP  路  4Comments

ToxicBakery picture ToxicBakery  路  4Comments