Gradle-play-publisher: Could not find ZipAlign task with valid signingConfig

Created on 27 May 2016  Â·  19Comments  Â·  Source: Triple-T/gradle-play-publisher

gradle-play-publisher fails although I specified a valid signingConfig, looking like this:

signingConfigs {
        debug {
            storeFile file("../keystore.jks")
            storePassword keystorePassword // coming from local.properties
            keyAlias "alias"
            keyPassword keystorePassword
        }
        release {
            storeFile file("../keystore.jks")
            storePassword keystorePassword
            keyAlias "alias"
            keyPassword keystorePassword
        }
    }
// ...
buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled true
            shrinkResources true
            zipAlignEnabled true // Tested with and without this parameter.

            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

        debug {
            signingConfig signingConfigs.debug
            applicationIdSuffix '.debug'
        }
    }

Error:

Could not find ZipAlign task. Did you specify a signingConfig for the variation InternalRelease?
Could not find ZipAlign task. Did you specify a signingConfig for the variation ProductionRelease?

I am using the Android Plugin version 2.2.0-alpha1.

Most helpful comment

@jhbruhn @bhurling @joernahrens Just upgraded to 1.1.5, it seems to be fixed!

All 19 comments

Same for me.
Upgraded to latest (stable) in SDK manager and gradle complains about ZipAlign task not found.

same here.. I assume this is why I don't see an option to publish a build. Any known workarounds to this?

Incremental java compilation is an incubating feature.
Could not find ZipAlign task. Did you specify a signingConfig for the variation ABCRelease?
Could not find ZipAlign task. Did you specify a signingConfig for the variation DEFRelease?
Play Store tasks
----------------
bootstrapABCReleasePlayResources - Downloads the play store listing for the ABCRelease build. No download of image resources. See #18.
bootstrapDEFReleasePlayResources - Downloads the play store listing for the DEFRelease build. No download of image resources. See #18.
generateABCReleasePlayResources - Collects play store resources for the ABCRelease build
generateDEFReleasePlayResources - Collects play store resources for the DEFRelease build
publishListingABCRelease - Updates the play store listing for the ABCRelease build
publishListingDEFRelease - Updates the play store listing for the DEFRelease build

Yes. I confirm this if I use Android Plugin version 2.2.0-alpha1.

Since it is alpha version, I won't dig into what they change. Use Android Plugin 2.1.0 for now, or remove https://github.com/Triple-T/gradle-play-publisher/blob/master/src/main/groovy/de/triplet/gradle/play/PlayPublisherPlugin.groovy#L91 this condition. Publish to your local maven and use it. Do it your own risk.

I confirmed that by setting the build tools to version 2.1.0 does work for releasing to the play store.

        classpath 'com.android.tools.build:gradle:2.1.0'

Only, this removes Android Studio's Instant Run feature which requires a later version.. Android Studio will actually update to the alpha version automatically for you in the instant run section.

I'd really like to figure out how to work-around this so I can have both :)

We don't have a local maven repo though. Is there a way to release an alpha/beta version of this gradle plugin? Is the reason you don't want to fix for the alpha Android plugin? Just wondering if it'll be an issue for everyone once this latest version goes into release anyway.

We don't have a local maven repo though. Is there a way to release an alpha/beta version of this gradle plugin?

There is comment that how to test/run this plugin somewhere in this repo. Again, I don't recommend you to do it.

Is the reason you don't want to fix for the alpha Android plugin? Just wondering if it'll be an issue for everyone once this latest version goes into release anyway.

I cannot fix this. I'm not maintainer of this plugin.

I found a better way to check for a valid signing config (I have never been too happy with the old solution anyway). But unfortunately, the missing zip align task creates a far bigger issue now. Looks like the APK that is generated through assembleRelease is no longer zip aligned and thus fails to upload to the play store. This even fails when I try uploading manually through the web interface. Did anyone of you succeed in manually uploading an APK that was built with 2.2.0-alpha1 or later?

I just filed a bug report to the Android Bug Tracker: https://code.google.com/p/android/issues/detail?id=213532
Please star it so it gets some visibility.

The current workaround is to add android.useOldPackaging=true to your gradle.properties file.

It seems to work with 2.2.0-beta1

edit: I messed this, sorry, it doesn't work :unamused:

I wanted to use Gradle 3.0 + 2.2.0-beta1 but this plugin seems to have an issue.

@cypressious Why? What does that do exactly?

@joernahrens You are right, this still does not work in 2.2.0-beta1.

@jhbruhn @bhurling @joernahrens Just upgraded to 1.1.5, it seems to be fixed!

Looks like APKs generated with 2.2.0-alpha4 or later are zip aligned by default. There is no special zipAlign task anymore so the changes introduced in 1.1.5 are enough to make things work again

They have been zipAligned by default for a long time. In the DSL, zipAlign
defaults to true.

On Sep 6, 2016 6:47 AM, "Björn Hurling" [email protected] wrote:

Looks like APKs generated with 2.2.0-alpha4 or later are zip aligned by
default. There is no special zipAlign task anymore so the changes
introduced in 1.1.5 are enough to make things work again

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Triple-T/gradle-play-publisher/issues/145#issuecomment-244955080,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABqMSDNG9yvKwmrDwMJr3s4FFpyGgl88ks5qnW72gaJpZM4IoCiF
.

So how comes I still don't see the Apk tasks?

  • Publisher 1.1.5
  • Android Gradle Plugin 2.2.0-rc
  • Gradle 3.0
Play Store tasks
----------------
bootstrapAnnieReleasePlayResources - Downloads the play store listing for the AnnieRelease build. No download of image resources. See #18.
bootstrapFoxyReleasePlayResources - Downloads the play store listing for the FoxyRelease build. No download of image resources. See #18.
bootstrapLoisReleasePlayResources - Downloads the play store listing for the LoisRelease build. No download of image resources. See #18.
generateAnnieReleasePlayResources - Collects play store resources for the AnnieRelease build
generateFoxyReleasePlayResources - Collects play store resources for the FoxyRelease build
generateLoisReleasePlayResources - Collects play store resources for the LoisRelease build
publishListingAnnieRelease - Updates the play store listing for the AnnieRelease build
publishListingFoxyRelease - Updates the play store listing for the FoxyRelease build
publishListingLoisRelease - Updates the play store listing for the LoisRelease build

@jaredsburrows Sorry, I wasn't clear enough. In older versions of the build plugin there was a special zipAlign task that fixed the output APK. The publisher plugin prior to 1.1.5 was looking for that task to determine whether or not the output APK is a valid (uploadable) file. As of 2.2.0 the google team removed that special task and the packaging task directly produces a valid APK file. As a result our old check did not work anymore and we had to move to something smarter:

See this change for details: https://github.com/Triple-T/gradle-play-publisher/commit/8e5a3ff8afd31c0c1f39e8f2e65c5e2c6d429ff0

@Pitel Are you sure you have specified valid signing configurations for all of your flavors?

Good point. I'm getting keys from environment variables, and after providing them, the Apk tasks are there. :+1:

So everything is still good?

Yes. Issue can stay closed. Cheers

On Tue, Sep 6, 2016, 16:25 Jared Burrows [email protected] wrote:

So everything is still good?

—
You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
https://github.com/Triple-T/gradle-play-publisher/issues/145#issuecomment-244966822,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAO1J_yZCtKIe5Gj1qQWL9CkeWmCxkroks5qnXfigaJpZM4IoCiF
.

Was this page helpful?
0 / 5 - 0 ratings