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

New Android App Bundle #262

Closed
thelittlefireman opened this issue May 9, 2018 · 29 comments
Closed

New Android App Bundle #262

thelittlefireman opened this issue May 9, 2018 · 29 comments
Assignees
Labels
enhancement Indicates new feature requests
Milestone

Comments

@thelittlefireman
Copy link

Hi,
Do you plan to integrate the new "Android App Bundle" feature ?
https://android-developers.googleblog.com/2018/05/io-2018-everything-new-in-google-play.html
https://www.youtube.com/watch?v=bViNOUeFuiQ

the new command is : 'gradlew app:bundle'
https://youtu.be/bViNOUeFuiQ?t=14m10s

Thanks for all
Thomas :)

@JakeWharton
Copy link

Seems like the API was updated to include them which is nice: https://developers.google.com/android-publisher/api-ref/edits/bundles. Should be a fairly straightforward change. The only problem I see is determining the developer intent as to whether they want to publish an APK or a bundle.

@gtcompscientist
Copy link
Contributor

gtcompscientist commented May 18, 2018

I've been trying to enable this with the intent of having parallel tasks for APKs and Bundles. Unfortunately, I'm at an impasse that I can't resolve.
Getting the Bundle API you have to use:

  • com.android.tools.build:gradle:3.2.0-alphaXX Currently alpha14, and
  • com.google.apis:google-api-services-androidpublisher:v2-rev76-1.23.0

These build just fine for the plugin. However, when I try to reference that plugin in a project that is compatible with 1.2.1-beta1, I get the following error on Gradle Sync:
Unable to load class 'com.google.api.client.googleapis.json.GoogleJsonResponseException'

https://github.com/gtcompscientist/gradle-play-publisher/tree/bundles

@gtcompscientist
Copy link
Contributor

Update, with my latest push, I've got it properly trying to push the bundle (wasn't setting the right dependsOn), but:

  • bundle for each variant isn't available the way that the assemble is
  • Also, the outputs for the variant doesn't contain the bundle.

The first "but" is relatively trivial, but would cause the plugin to crash/fail Gradle sync for a project that doesn't use a version of Android Tools that includes the bundle tasks.

The second "but" is thornier, because you would end up hunting for that file, which is 😞...

gtcompscientist added a commit to gtcompscientist/gradle-play-publisher that referenced this issue May 18, 2018
gtcompscientist added a commit to gtcompscientist/gradle-play-publisher that referenced this issue May 18, 2018
@JakeWharton
Copy link

File a bug for each and link it here. I will escalate.

gtcompscientist added a commit to gtcompscientist/gradle-play-publisher that referenced this issue May 18, 2018
…but currently it doesn't successfully upload for me. [Triple-T#262]
@gtcompscientist
Copy link
Contributor

gtcompscientist commented May 18, 2018

Was able to get the bundle (albeit somewhat surreptitiously) and attempt the upload.

From my logging it appears to properly upload all of the data (~35.6MB), but there's a timeout happening inside the upload().execute() command.

Relevant Code: PlayPublishBundleTask.groovy:Line 50
def bundle = edits.bundles().upload(variant.applicationId, editId, bundleFile).execute()
Stack trace:
stack_trace.txt

@SUPERCILEX
Copy link
Collaborator

SUPERCILEX commented May 18, 2018

Yeah, you'll want to go into the helper file and wrap the credential in an intercepter which boosts the timeouts. I was going to share my fork with everyone a few days ago, but I get a weird 404 everytime I try uploading. I've contacted support so we'll see how that goes.

@gtcompscientist
Copy link
Contributor

🤦‍♂️ Great tip, @SUPERCILEX, definitely helped.

However, it appears there's another issue in the API with uploading secondary data:
#79951879 Unable to upload deobfuscation files through API after uploading bundle through API
#79951880 Unable to upload "What's New" text through API after uploading bundle through API

Digging into the API a little more, it looks like there may be a deeper change needed in how the plugin handles the "What's New" (See: Edit.tracks)

gtcompscientist added a commit to gtcompscientist/gradle-play-publisher that referenced this issue May 18, 2018
…le uploading of deobfuscation files, and "What's new" until the bugs are sorted out with that data coming after a Bundle upload. [Triple-T#262]
gtcompscientist added a commit to gtcompscientist/gradle-play-publisher that referenced this issue May 18, 2018
@JakeWharton
Copy link

Just a heads up that those two issues might be closed since they're problems with the Google Play Developer API and not Android Gradle itself. If they are I'll file them internally. I would also look for a place to report feedback directly to the Google Play Developer team on their website/documentation.

@SUPERCILEX
Copy link
Collaborator

Yeah, I used the question icon on the Play Console to file a support request. I'll update this issue whenever it gets resolved, but dunno if @gtcompscientist you want to file a request too anyway.

@gtcompscientist
Copy link
Contributor

I'll submit one when I get back to my machine, I should have realized I needed to submit those there.

@bhurling
Copy link
Contributor

@gtcompscientist looks like they released a v3 of their client library to support the new tracks/releases structure: com.google.apis:google-api-services-androidpublisher:v3-rev3-1.23.0 but it requires some refactoring of the publishing tasks. Wanna give it a shot?

@gtcompscientist
Copy link
Contributor

@bhurling Yep. I'll dig in today, if I have time. Definitely changes a fair amount!

@SUPERCILEX SUPERCILEX added the enhancement Indicates new feature requests label May 24, 2018
@SUPERCILEX SUPERCILEX added this to the 2.0.0 milestone May 24, 2018
gtcompscientist added a commit that referenced this issue May 24, 2018
…tConfig" on Gradle tools 2.3.0, but success on 3.1.0! [#262]
gtcompscientist added a commit that referenced this issue May 25, 2018
…tConfig" on Gradle tools 2.3.0, but success on 3.1.0! [#262]
gtcompscientist added a commit that referenced this issue May 25, 2018
…ay-publisher into cb/wip/kotlin

* 'cb/wip/kotlin' of https://github.com/Triple-T/gradle-play-publisher:
  More exhaustive Plugin version testing for Kotlin. Digging in I'd like to see if there's a way to solve this, before forcing people to update old AGP versions.
  Update plugin tests to be more exhaustive. They are ignored by default, because they take too long to run for everyday tests.
  Test suite to show the failure of the plugin usage of "android.defaultConfig" on Gradle tools 2.3.0, but success on 3.1.0! [#262]
  Bump the timeout to 100 seconds for http connections, and add a configuration option in case this needs to be adjusted by individual projects for bandwidth/size issues. [#144]
  Fix readme reference as suggested in PR
@gtcompscientist
Copy link
Contributor

Thinking more about this, I don't think we should add a task for this, you're either uploading Bundles or APKs, so it should probably be a configuration flag. This, of course, assumes that some of the previously mentioned issues are corrected anytime soon.

@knordbo
Copy link
Contributor

knordbo commented Jun 29, 2018

Any estimate on when this will be available from the snapshot release? Would be awesome to try out.

@SUPERCILEX
Copy link
Collaborator

@knordbo I'll see if we can get this in a snapshot build tomorrow. (The code is there, it's just waiting to be reviewed)

@knordbo
Copy link
Contributor

knordbo commented Jun 29, 2018

@SUPERCILEX cheers!

@hardysim
Copy link

hardysim commented Jul 3, 2018

So it's done? Great 👍

Which version / snapshot do I need? And how do I enable it to output an App Bundle instead of an APK?

@SUPERCILEX
Copy link
Collaborator

SUPERCILEX commented Jul 3, 2018

There are a new set of tasks:

  • publishBundle - publish all variants
  • publishReleaseBundle - for specific variants

If you're using publish or publishRelease, you'll want to enable bundles:

play {
    // ...
    defaultToAppBundles = true
}

This is false by default because App Bundles require Google Play App Signing.

The snapshot build instructions are available here.

@peterfortuin
Copy link

I tested the snapshot build and I could upload my app bundle without any problems! Thanks for the awesome work!

@SUPERCILEX
Copy link
Collaborator

@peterfortuin Woot! v2.0 is going to be awesome! 😁

@hardysim
Copy link

2.0.0-SNAPSHOT seems broken 😢

Could not set unknown property 'pk12File' for object of type com.github.triplet.gradle.play.PlayPublisherExtension.

When switching to jsonFile I get a similar error.
Has someone tested this?

@knordbo
Copy link
Contributor

knordbo commented Jul 20, 2018

Change jsonFile to serviceAccountCredentials

@hardysim
Copy link

Thx @knordbo - that's helping.

But now I'm running into the next error:

What went wrong:
A problem was found with the configuration of task ':app:publishReleaseBundle'.
Directory 'app\build\generated\gpp\release\res\release-notes' specified for property 'releaseNotesDir$plugin' does not exist.

Is there a readme / howto on how to migrate to 2.0.0? I've only found the CHANGELOG but there's nothing about the release-notes.

@knordbo
Copy link
Contributor

knordbo commented Jul 20, 2018

I've reported that issue before @SUPERCILEX might know when the fix for it will be in. The workaround is to create the play folder with release notes inside.

@hardysim
Copy link

Hmm, I cannot find a corresponding issue for the release-notes folder (only #361 when the whole play-folder is missing).

I found out, that I needed to create the file src/main/play/release-notes/en-US/default. With that, the publishing works and an App Bundle is pushed to the store 🎉.

@knordbo
Copy link
Contributor

knordbo commented Jul 20, 2018

Yup that is the workaround. Issue #361 is indeed the problem. It appears to be marked resolved, but as you point out the issue still remains.

@SUPERCILEX
Copy link
Collaborator

@hardysim @knordbo My apologies, you two were right. 😊 I had tested the release notes fix without running a clean so I had the folder left over. Anyway, #390 actually fixes the issue.

@hardysim
Copy link

hardysim commented Sep 14, 2018

Will there be a new release with this included (when)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Indicates new feature requests
Projects
None yet
Development

No branches or pull requests

8 participants