Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to upload apk from different modules #636

Closed
nishithkhanna opened this issue Jul 24, 2019 · 10 comments · Fixed by #639
Closed

How to upload apk from different modules #636

nishithkhanna opened this issue Jul 24, 2019 · 10 comments · Fixed by #639
Labels
docs Indicates issues where the documentation should be changed or enhanced feature:apk Involves APKs feature:bundle Involves app bundles

Comments

@nishithkhanna
Copy link

Hi, Firstly thanks so much for such an awesome tool to upload apk automatically. I had a doubt.
My project has 4 different modules like

  1. Nougat
  2. Oreo 8.0
  3. Oreo 8.1
  4. Pie
    When I do ./gradlew publishReleaseApk It only uploads apk from one of these modules and uploads it to the track mentioned.
    So only way to upload all apk's is to use ./gradlew publishApk and enter the folder name where all 4 apk's are there. It does the trick but the build fails and the error message for each module is
* What went wrong:
Execution failed for task ':Pie:publishReleaseApk'.
> com.google.api.client.googleapis.json.GoogleJsonResponseException: 410 Gone
  {
    "code" : 410,
    "errors" : [ {
      "domain" : "androidpublisher",
      "message" : "This Edit has been deleted.",
      "reason" : "editDeleted"
    } ],
    "message" : "This Edit has been deleted."
  }

So is there a way to upload apk's from each module without build failing.
I am on v2.2.1 of gpp as am not using AS 3.5 right now which is required on v2.3.0 plugin.

Thanks in advance for your help.

@SUPERCILEX SUPERCILEX added docs Indicates issues where the documentation should be changed or enhanced feature:apk Involves APKs feature:bundle Involves app bundles labels Jul 24, 2019
@SUPERCILEX
Copy link
Collaborator

Right, this is where GPP struggles. I've written some new docs, please let me know if you're able to follow them: https://github.com/Triple-T/gradle-play-publisher/tree/commit-docs#combining-artifacts-into-a-single-release

@nishithkhanna
Copy link
Author

Hi, Thanks for your reply. I would need to be on latest snapshot or this will work on 2.2.1 too?

@nishithkhanna
Copy link
Author

Also I had one more doubt. For example I push my app to internal and would like to promote it to beta always. Is there anyway to do it? Or will have to use that cli command mentioned in readme. If there is any gradle changes that can be done to make it permanent that will be awesome. Sorry this is not related to the main issue but thought to ask here instead of making another issue for it.

@nishithkhanna
Copy link
Author

Right, this is where GPP struggles. I've written some new docs, please let me know if you're able to follow them: https://github.com/Triple-T/gradle-play-publisher/tree/commit-docs#combining-artifacts-into-a-single-release

My case is a little different as its not a flavor but module so publishNougatReleaseApk will not work.
To explain in a better way to compile a particular module I do
./gradlew :Nougat:assembleRelease

@SUPERCILEX
Copy link
Collaborator

Replying to each of your comments:

  • The commit stuff has been around since v2.1.0 so you should be fine without snapshots.
  • Lol, I do that too. And no, GPP doesn't support that, but we should absolutely have an official solution, so I've created Support publishing then promoting artifacts within the same build #638. PS: I have some hacks I use, but they're really sad and ugly, especially considering I maintain GPP.
  • Hmmm, haven't seen that one before. You can actually make it work, but you'll have to prefix all the task names with :project:... and move the ordering configuration to your root build script. Though, TBH, I don't understand the use case. Why not just use product flavors? That's what they were built for. 😜

@nishithkhanna
Copy link
Author

Regarding why we use module is that because in android folder structure in studio they are pretty easily visible.
Screenshot_20190725_121237

But flavors folder are not visible in android view and the only way to see them is by changing view to project which takes some time to navigate to particular sdk version. So it is sort of a hack to make navigating easier hehehe.

@SUPERCILEX
Copy link
Collaborator

Lol, ok. I can't justify supporting your use case, but you should be able to make it work with the changes I mentioned above.

I'm going to close this issue, but let me know if you run into any trouble.

@nishithkhanna
Copy link
Author

nishithkhanna commented Jul 30, 2019

Hi, I changed to flavors instead of modules and the new docs worked like a charm. Thanks for the help. I saw you did some changes for promoting apps. Thanks for that too. Will wait when android studio 3.5 is rolled to stable and docs are updated then will use it.
Thanks again for all the help and for your patience.

@SUPERCILEX
Copy link
Collaborator

Awesome!

@nishithkhanna
Copy link
Author

Hey again, So as said above I shifted to product flavors. When trying to promote it from internal to production the build doesn't fail but the app is not being promoted.

I used

./gradlew promoteArtifact \
  --from-track internal --track production \
  --release-status completed

using this in play configs as stated in the doc

playConfigs {
        nougat {
            commit = false
        }

        oreo26 {
            commit = false
        }
        oreo27 {
            commit = false
        }
        pie {
            commit = true
        }
    }

and used this

afterEvaluate {
    def intermediateTasks = [
            "publishOreo26ReleaseApk",
            "publishOreo27ReleaseApk"
    ]
    tasks.matching { intermediateTasks.contains(it.name) }.configureEach {
        mustRunAfter("publishNougatReleaseApk")
    }
    tasks.named("publishPieReleaseApk").configure {
        mustRunAfter(intermediateTasks)
    }
}

But promotion didn't work. Need to add anything else? Using v2.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Indicates issues where the documentation should be changed or enhanced feature:apk Involves APKs feature:bundle Involves app bundles
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants