ReleaseNotes returns 'null' for Android

80 Views Asked by At

In my project I have used flutter package new_version, And till now it was working perfectly fine. But now its not working as the "Release Notes" from play store returns null. The error is as follows

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: NoSuchMethodError: The method '[]' was called on null. E/flutter (10282): Receiver: null E/flutter (10282): Tried calling: [](1) E/flutter (10282): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:38:5) E/flutter (10282): #1 NewVersion._getAndroidStoreVersion (package:new_version/new_version.dart:197:37) E/flutter (10282): <asynchronous suspension>

Release notes are the only responsible for this error.

As its showing error at this line: releaseNotes = data[1][2][144][1][1]; in new_version.dart(line: 197) file. I just tried changing these indexes in this file but nothing worked.

1

There are 1 best solutions below

3
Aakash Kumar On

As far as I know, since the new playstore web design its not showing whats new anymore. I crossed checked this with my own application which have whats new text in mobile but on playstore is not showing this text.

I even tried searching the text from my whats new in source code of play store listing page. But it's not even there. So I am afraid this release notes field is no longer available.

Suggestion

You can still solve this issue by two ways.

  1. Create a table inside you db with 4 fields named versionCode, Platform, forceUpdate & releaseNotes. Here you can add your update data, use this data to show custom modals and keep the history of each release. You can use forceUpdate field to provide the functionality to check if this update is must for user or not.

  2. Create a json with same 4 values & host it on your server. You can read this json from within your app.

After this you can write your own dialog code or use some package like https://pub.dev/packages/flutter_update_dialog.

I my opinion these two solutions are more accurate, scalable & future proof.