Ulrich Sah
Ulrich Sah

Reputation: 1

flutter new_version works only with "com.snapchat.android" but not with "com.whatsapp"

this code works

 void _checkVersion()async{
final newVersion=NewVersion(
  androidId: "com.snapchat.android",
);
final status=await newVersion.getVersionStatus();
if(status?.canUpdate==true){
  newVersion.showUpdateDialog(
    context: context,
    versionStatus: status!,
    allowDismissal: false,
    dialogTitle: "UPDATE",
    dialogText: "Please update the app from ${status.localVersion} to ${status.storeVersion}",

);}}

but this code is not working

 void _checkVersion()async{
final newVersion=NewVersion(
  androidId: "com.whatsapp",
);
final status=await newVersion.getVersionStatus();
if(status?.canUpdate==true){
  newVersion.showUpdateDialog(
    context: context,
    versionStatus: status!,
    allowDismissal: false,
    dialogTitle: "UPDATE",
    dialogText: "Please update the app from ${status.localVersion} to ${status.storeVersion}",

);}}

E/flutter ( 2974): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: NoSuchMethodError: The method '[]' was called on null. E/flutter ( 2974): Receiver: null

Please can you help me ?

Upvotes: 0

Views: 619

Answers (1)

Pushkar Mishra
Pushkar Mishra

Reputation: 31

androidId: "com.whatsapp" is working now. The Error "The method '[]' was called on null" comes with android id when we forget to mention "Release Note" while uploading aab to google play console. Above Error only occurs when NewVersion is unable to find release note thus returns null

Upvotes: 2

Related Questions