flutter_distributor icon indicating copy to clipboard operation
flutter_distributor copied to clipboard

Error `Null` when publishing to playstore tracks

Open shiipou opened this issue 11 months ago • 3 comments

We can't publish to a playstore tracks because of the oogleapis/androidpublisher/v3 seems outdated. The google API return a null value on update tracks instead of returning map<string, dynamic>.

🎉 You are using the latest version (0.5.1)

[playstore]
type 'Null' is not a subtype of type 'Map<String, dynamic>' in type cast
#0      EditsTracksResource.update (package:googleapis/androidpublisher/v3.dart:2633:37)
<asynchronous suspension>
#1      AppPackagePublisherPlayStore.publish (package:flutter_app_publisher/src/publishers/playstore/app_package_publisher_playstore.dart:56:7)
<asynchronous suspension>

https://github.com/google/googleapis.dart/blob/36f16409207c1098541d89e15def2f4e2fedd666/generated/googleapis/lib/androidpublisher/v3.dart#L2633C12-L2633C17

shiipou avatar May 05 '25 15:05 shiipou

same error here. when executing command:

fastforge publish --path build/app/outputs/bundle/prodRelease/app-prod-release.aab --targets playstore --playstore-package-name 'fr.neutronic.xxxx' --playstore-track internal-testing

return error:

type 'Null' is not a subtype of type 'Map<String, dynamic>' in type cast
#0      EditsTracksResource.update (package:googleapis/androidpublisher/v3.dart:2633:37)
<asynchronous suspension>
#1      AppPackagePublisherPlayStore.publish (package:flutter_app_publisher/src/publishers/playstore/app_package_publisher_playstore.dart:56:7)

Xiaohequ avatar May 28 '25 14:05 Xiaohequ

@Xiaohequ same error here. when executing command:

fastforge publish --path build/app/outputs/bundle/prodRelease/app-prod-release.aab --targets playstore --playstore-package-name 'fr.neutronic.xxxx' --playstore-track internal-testing

Not a fix, but it seems your playstore-track argument must be qa not internal-testing. See the doc : https://developers.google.com/android-publisher/tracks#ff-track-name

shiipou avatar May 28 '25 14:05 shiipou

@Xiaohequ After more test on my side, the doc seems incorrect, the internal-testing track name is just internal. I tried it using gcloud API, you have to create an edit, then get the edit ID. With that edit ID, you can list all your tracks.

Create edit

Image

Image

List all tracks

Image

Image

So here you can test it yourself.

But sadly, using this track name didn't fix the upload for me. I switched using fastlane instead :

fastlane upload_to_play_store --json_key ./service-account.json --package_name com.example.app --aab ../build/app/outputs/bundle/release/app-release.aab --track internal --release_status draft

shiipou avatar Jun 27 '25 08:06 shiipou