android bundleRelease does not sign the aab

tbeernot picture tbeernot · Jun 8, 2019 · Viewed 7.7k times · Source

I've written an Android app, but the final step in the release process is still eluding me. I assume that when I run gradle bundleRelease it will generate the aab file I can upload in the play store. But the play store says the bundle is unsigned. However, the build process says it is signing:

> Task :app:preBuild UP-TO-DATE
> Task :app:preReleaseBuild UP-TO-DATE
> Task :app:compileReleaseRenderscript NO-SOURCE
> Task :app:generateReleaseResValues UP-TO-DATE
> Task :app:generateReleaseResources UP-TO-DATE
> Task :app:mergeReleaseResources UP-TO-DATE
> Task :app:checkReleaseManifest UP-TO-DATE
> Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE
> Task :app:mainApkListPersistenceRelease UP-TO-DATE
> Task :app:processReleaseManifest UP-TO-DATE
> Task :app:bundleReleaseResources UP-TO-DATE
> Task :app:checkReleaseDuplicateClasses UP-TO-DATE
> Task :app:mergeExtDexRelease UP-TO-DATE
> Task :app:compileReleaseAidl NO-SOURCE
> Task :app:generateReleaseBuildConfig UP-TO-DATE
> Task :app:prepareLintJar UP-TO-DATE
> Task :app:generateReleaseSources UP-TO-DATE
> Task :app:javaPreCompileRelease UP-TO-DATE
> Task :app:processReleaseResources UP-TO-DATE
> Task :app:compileReleaseJavaWithJavac UP-TO-DATE
> Task :app:transformClassesWithDexBuilderForRelease UP-TO-DATE
> Task :app:mergeDexRelease UP-TO-DATE
> Task :app:mergeReleaseShaders UP-TO-DATE
> Task :app:compileReleaseShaders UP-TO-DATE
> Task :app:generateReleaseAssets UP-TO-DATE
> Task :app:mergeReleaseAssets UP-TO-DATE
> Task :app:mergeReleaseJniLibFolders UP-TO-DATE
> Task :app:transformNativeLibsWithMergeJniLibsForRelease UP-TO-DATE
> Task :app:processReleaseJavaRes NO-SOURCE
> Task :app:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
> Task :app:buildReleasePreBundle UP-TO-DATE
> Task :app:collectReleaseDependencies UP-TO-DATE
> Task :app:configureReleaseDependencies UP-TO-DATE
> Task :app:packageReleaseBundle UP-TO-DATE
> Task :app:signingConfigWriterRelease UP-TO-DATE
> Task :app:signReleaseBundle
> Task :app:bundleRelease

There is a signing section in the gradle build script:

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

If I delete all aab files prior to running the build, an app.aab is generated in

..\app\build\outputs\bundle\release

Seems all in order, except the play store won't accept the aab:

The Android App Bundle was not signed.

How do I build a releasable aab?

Answer

spiraldev picture spiraldev · Nov 3, 2019

If anyone is still looking for a solution - Set debuggable to false in release config. Your app build gradle file should have following -

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