Gradle-play-publisher: Task 'publishApkRelease' not found in root project

Created on 16 Jul 2015  路  7Comments  路  Source: Triple-T/gradle-play-publisher

Hi gradle-play-publisher team,

Im getting Error "Task 'publishApkRelease' not found in root project" on running "./gradlew publishApkRelease --stacktrace"

Here's the question:
http://stackoverflow.com/questions/31449533/task-publishapkrelease-not-found-in-root-project

Please let me know what Im doing wrong here?
It would be convenient if you could share sample project code with "gradle-play-publisher" configurations and structure.

Thanks,
Aqib Mumtaz

Most helpful comment

I know this is closed, but I wanted to add a case that I just ran into:

Setting debuggable to true (in the release buildType) also causes this issue. Switching this back to false solved the issue.

All 7 comments

@aqibmumtaz do you have a Flavours?
If so - you need to put your flavour name before Release word. E.g. publishApkMyFlavor1Release.
Check readme for details.

See my response on stackoverflow: http://stackoverflow.com/a/31458855/1216407

I'm having the same issue. My configuration was previously uploading my release APK successfully, however I started getting this error a week or so ago and I am unsure what changed since it stopped working. I have tried upgrading and downgrading gradle versions, different block arrangements in my build.gradle files, all with no success. I am not using flavours.

When running './gradle publishApkRelease --debug' I can see that the dependency is acquired successfully, however './gradlew tasks' does not list any of the tasks supposedly provided by this project.

After a bit more trial and error I found that my project appeared to have incomplete signingConfigs, where the fault was with my continuous integration agent.

I would suggest ensuring that you have a complete release signing config in your app module build.gradle file, correct for your keystore.

signingConfigs {
  release {
    storeFile file("%%%%")
    storePassword %%%%
    keyAlias "%%%%"
    keyPassword %%%%
  }
}

Thanks for your answers, Im able to fix it but now Im stuck in this, I want to publish first APK without using web interface http://stackoverflow.com/questions/31493889/gradle-play-publisher-publishing-first-version

any help?

@mherod is right. The publisher plugin won't create the publishXYZTasks whenever there is something wrong with the signingConfig. In that case there won't be a releasable APK anyway and the plugin prints a warning:

$ ./gradlew tasks
Could not find ZipAlign task. Did you specify a signingConfig for the variation Release?
:tasks

------------------------------------------------------------
All tasks runnable from root project
------------------------------------------------------------

Android tasks
-------------
androidDependencies - Displays the Android dependencies of the project.
signingReport - Displays the signing info for each variant.
...

I know this is closed, but I wanted to add a case that I just ran into:

Setting debuggable to true (in the release buildType) also causes this issue. Switching this back to false solved the issue.

Was this page helpful?
0 / 5 - 0 ratings