Search code examples
androidandroid-gradle-pluginandroid-build

./gradlew assembleRelease doesn't give me a signed apk


I'm seeing an instance where ./gradlew assembleRelease is not actually outputting a signed apk. The build finishes with no errors (at least as far as I can tell).

I tested to see if the credentials portion isn't working, but when providing no credentials or incorrect credentials (as a test to see if the signing portion fails silently), the build obviously fails (red letters - BUILD FAILED).

At the end of the ./gradlew assembleRelease I end up with unsigned builds in my outputs/apk dir. I've tried doing a ./gradlew clean and re-running. I verified that this directory gets removed and recreated.

Any recommendations to help troubleshoot this?


Solution

  • Had some hackery (-_-) going on to rename the apk (variant.outputs.each //...) which caused the problems.

    Used the following instead

        project.ext.set('archivesBaseName', 'appname-' + versionName + '-' + versionCode);