Closed ibatica closed 5 months ago
Are there any workarounds other than manually deploying?
Hi, we also require this for our wear app where Google requires all wear apps to be on a seperate track by end of August 2023
https://support.google.com/googleplay/android-developer/answer/13295490?hl=en
We have a wear app and since Google has started enforcing form factor publishing we can't use properly this plugin. A form factor option would really be great.
Is there any workaround? We are kinda slowly approaching the deadline. I assume we need to enable the form factor track and then publish the wear app manually?
We're running into the same problem now. Is there any update on when it will be supported or any workaround to solve the issue?
I'm not involved with the project anymore, but I still do PR reviews if people want to fix this.
We're facing the same issue.
I looked at this problem again as it has to be solved soon and now it seems to all work for me as expected.
What I did:
play {
serviceAccountCredentials.set(project.rootProject.ext.play_credentials)
track.set("wear:" + project.findProperty("play.track"))
defaultToAppBundles.set(true)
if (project.rootProject.ext.play_release_fraction >= 1d) {
releaseStatus.set(com.github.triplet.gradle.androidpublisher.ReleaseStatus.COMPLETED)
} else {
releaseStatus.set(com.github.triplet.gradle.androidpublisher.ReleaseStatus.IN_PROGRESS)
}
updatePriority.set(project.rootProject.ext.play_update_priority)
userFraction.set(project.rootProject.ext.play_release_fraction)
releaseName.set(project.rootProject.ext.version_name)
}
play {
serviceAccountCredentials.set(project.rootProject.ext.play_credentials)
track.set(project.findProperty("play.track"))
defaultToAppBundles.set(true)
if (project.rootProject.ext.play_release_fraction >= 1d) {
releaseStatus.set(com.github.triplet.gradle.androidpublisher.ReleaseStatus.COMPLETED)
} else {
releaseStatus.set(com.github.triplet.gradle.androidpublisher.ReleaseStatus.IN_PROGRESS)
}
updatePriority.set(project.rootProject.ext.play_update_priority)
userFraction.set(project.rootProject.ext.play_release_fraction)
releaseName.set(project.rootProject.ext.version_name)
}
./gradlew :app-wear:publishReleaseBundle -Pplay.track=closed-beta -Pplay.fraction=1.0
(Make sure "Closed Beta" is set up for the wear form factor)Hey @crysxd , thanks for your input. I can't manage to make it work still. This is what we currently have, which seems to replicate your behavior above by adding wear:
to the track:
build.gradle project level
buildscript {
...
dependencies {
...
classpath 'com.github.triplet.gradle:play-publisher:3.8.4'
}
}
build.gradle mobile app level
apply plugin: 'com.github.triplet.play'
...
play {
track = "internal"
serviceAccountCredentials = file(GOOGLE_ACCOUNT_SERVICE_FILE)
// Commit this build separately from the wear build.
commit = true
}
build.gradle wear app level
apply plugin: 'com.github.triplet.play'
...
play {
track = "wear:internal"
serviceAccountCredentials = file(GOOGLE_ACCOUNT_SERVICE_FILE)
// Commit this build separately from the mobile build.
commit = true
}
However, I'm receiving the following error:
What am I missing?
Which version are you using?
3.7.0
Found it, had to remove the commit = true
line. Thank you!
I am also facing this issue and I am still getting the "Cannot convert URL 'wear:production.txt' to a file." error, no matter if I remove commit property entirely or set it to true or false. @damiafuentes: Did you change anything else?, @crysxd: Which OS are you on? Maybe this is a Linux / Windows issue? I am on Windows.
I think the problem is that GPP tries to generate and/or read from files which are named by the track name (e.g. File(locale, "$track.txt")). In case of track names with prefix (i.e. wear:production) this name contains the char ":" which is invalid for file names (at least on Windows). This is why it works if you set the release name explicitely by usage of releaseName.set("XXX") and only use default release notes. In this case, the track name file are not needed (not read at all or a fallback in case of failure exists).
Thanks @positive-infinity, can confirm, this is the minimal working example as of version 3.8.4 of this plugin:
play {
track.set("wear:$yourTrackName")
releaseName.set("$yourVersionName")
}
play {
track.set("automotive:$yourTrackName")
releaseName.set("$yourVersionName")
}
Hello, we are hitting this as well with automotive. It seems like the fix from @chimbori should work - is it possible to merge it upstream?
@SUPERCILEX could you review a PR for this?
Sure
The fix should be available in snapshot builds.
Thanks so much!! Any idea when the next release will be?
Can someone check that snapshot builds work as expected?
I fiddled around with Gradle, Version Catalogs, plugin IDs, Sonatype identifiers, etc. for far too long, but was not able to get my projects to use the Snapshot version. Any chance you would consider simply publishing this to a regular release, and I could test/verify afterwards?
(To be clear, this failure is simply in getting Gradle to play well with Sonatype Snapshots repo, I wasn’t even able to test this plugin to see if it works or not.)
Alright, I decided to say screw it and pray that we didn't break anything. I just triggered a release so it would be helpful if you could dogfood v3.11 before people notice it's out.
Just tested; nothing broke, but Wear publishing wasn't fixed either. 😔
I'm going to try to see if I can run a local copy of the plugin, but it's late tonight, so likely tomorrow.
Thanks for the quick push, I'll update this thread.
Made progress, but not resolved yet.
Turns out that a part of the problem was that the Bootstrap task had previously downloaded (successfully) files named wear:alpha.txt
etc. to my local repo, and I had committed them to Git as well. Deleting them got rid of the original error I was seeing, so my PR has at least made a difference there. Needs another PR to have the Bootstrap task rename files to filename-safe characters when downloading.
But now, Play is not able to find the right track, so I’m looking at that.
Execution failed for task ':xxx:publishReleaseBundle'.
> A failure occurred while executing com.github.triplet.gradle.play.tasks.PublishBundle$Processor
> 404 Not Found
PUT https://androidpublisher.googleapis.com/androidpublisher/v3/applications/xxx/edits/yyy/tracks/wear:alpha
{
"code": 404,
"errors": [
{
"domain": "global",
"message": "Track not found: wear:alpha.",
"reason": "notFound"
}
],
"message": "Track not found: wear:alpha.",
"status": "NOT_FOUND"
}
Interesting, thanks for sharing. Maybe there's a different way to publish colon tracks?
Using track name alpha
instead of wear:alpha
leads to a 400 too:
> 400 Bad Request
POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/xxx/edits/yyy:commit?changesNotSentForReview=false
{
"code": 400,
"errors": [
{
"domain": "global",
"message": "The APK or bundle with version code 20002 requires the Wear OS system feature android.hardware.type.watch. To publish this release on the current track, remove this artifact.",
"reason": "badRequest"
}
],
"message": "The APK or bundle with version code 20002 requires the Wear OS system feature android.hardware.type.watch. To publish this release on the current track, remove this artifact.",
"status": "INVALID_ARGUMENT"
}
This used to be so straightforward. Google messed it up badly. :(
Problem description
Currenlty it is possible to upload only for phone/tablet form, "automotive" and "wear" forms are not support.
Potential solutions/workarounds
In order to support form factor by Android Publishing API track should be defined as wear:production" or "wear:beta", "automotive:internal" This doesn't work with current implementation.
Additional context
Android Publishing API track and form factor https://developers.google.com/android-publisher/tracks