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

Support for form factor #1088

Open
ibatica opened this issue May 4, 2023 · 16 comments
Open

Support for form factor #1088

ibatica opened this issue May 4, 2023 · 16 comments
Labels
dontclose Prevents the stale bot from closing this issue/pr enhancement Indicates new feature requests

Comments

@ibatica
Copy link

ibatica commented May 4, 2023

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

@ibatica ibatica added the enhancement Indicates new feature requests label May 4, 2023
@SUPERCILEX SUPERCILEX added the dontclose Prevents the stale bot from closing this issue/pr label May 4, 2023
@JBassett
Copy link

Are there any workarounds other than manually deploying?

@markchristopherng
Copy link

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

@sorinirimies
Copy link

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.

@crysxd
Copy link

crysxd commented Jul 22, 2023

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?

@adrianolc
Copy link

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?

@SUPERCILEX
Copy link
Collaborator

I'm not involved with the project anymore, but I still do PR reviews if people want to fix this.

@damiafuentes
Copy link

We're facing the same issue.

@crysxd
Copy link

crysxd commented Aug 8, 2023

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:

  • Create the Wear track in Google Play, this was offered to me in a banner in the Release overview in the Google Play Console
  • Update my wear gradle config
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)
}
  • For reference, my phone gradle config:
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)
}
  • I then uploaded a new build to the closed beta with ./gradlew :app-wear:publishReleaseBundle -Pplay.track=closed-beta -Pplay.fraction=1.0 (Make sure "Closed Beta" is set up for the wear form factor)

@damiafuentes
Copy link

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:

Screenshot 2023-08-09 at 2 15 29 PM

What am I missing?

@damiafuentes
Copy link

Which version are you using?

@crysxd
Copy link

crysxd commented Aug 10, 2023

3.7.0

@damiafuentes
Copy link

damiafuentes commented Aug 10, 2023

Found it, had to remove the commit = true line. Thank you!

@positive-infinity
Copy link

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.

@positive-infinity
Copy link

positive-infinity commented Aug 14, 2023

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).

@avalanchas
Copy link

avalanchas commented Aug 22, 2023

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")
}

chimbori pushed a commit to chimbori/gradle-play-publisher that referenced this issue Jan 4, 2024
…fully without crashing. Triple-T#1088

For releases named `formfactor:track`, try `formfactor-track.txt` and `track.txt` instead of invalid filename `formfactor:track.txt`
@eytanbiala
Copy link

eytanbiala commented Mar 19, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dontclose Prevents the stale bot from closing this issue/pr enhancement Indicates new feature requests
Projects
None yet
Development

No branches or pull requests