SFDX-Data-Move-Utility icon indicating copy to clipboard operation
SFDX-Data-Move-Utility copied to clipboard

NeedUpdate method for android not working

Open nikesh8 opened this issue 3 years ago • 17 comments

The below function not working, getting an empty response while I am checking on Android but it works for iOS.

VersionCheck.needUpdate()
  .then(async res => {
    console.log(res.isNeeded);    // true
    if (res.isNeeded) {}
});

I am using the latest version of this library.

react-native: 0.63.2 react-native-version-check: 3.4.2

Can anyone have any fix for this issue?

nikesh8 avatar Jun 16 '21 05:06 nikesh8

try add country code inside needUpdate will work VersionCheck.needUpdate({ country: 'eg' })

Moustafa-mahmaed avatar Jun 23 '21 08:06 Moustafa-mahmaed

@Moustafa-mahmaed I tried to add country code, but it won't work and I am getting res undefined it seems like res isn't parsable.

nikesh8 avatar Jun 28 '21 07:06 nikesh8

@nikesh8 Did you find a solution?

tolik85 avatar Jul 19 '21 19:07 tolik85

VersionCheck.needUpdate({ country: 'eg' }) .then(async res => { console.log(res.isNeeded); if (res.isNeeded) { }else{ } });

same problem facing

Possible Unhandled Promise Rejection (id: 76): TypeError: undefined is not an object (evaluating 'res.isNeeded')

sureshhallyali avatar Jul 26 '21 05:07 sureshhallyali

@nikesh8 Did you find a solution?

Not yet

nikesh8 avatar Jul 26 '21 06:07 nikesh8

VersionCheck.needUpdate({ country: 'eg' }) .then(async res => { console.log(res.isNeeded); if (res.isNeeded) { }else{ } });

same problem facing

Possible Unhandled Promise Rejection (id: 76): TypeError: undefined is not an object (evaluating 'res.isNeeded')

Please add your response which you are getting in res

nikesh8 avatar Jul 26 '21 06:07 nikesh8

it is just crashing whenever you call needUpdate or whatever. I saw Network Request Failure error several times it is seems like whenever request is rejected the app crashes even if it is wrapped in try/catch

nikopolidi avatar Aug 30 '21 12:08 nikopolidi

Hi, i have the same problem, when i call VersionCheck.getLatestVersion() the app crash. I also saw in console [TypeError: Network request failed].

After some research i found the error thrown: NoSuchMethodError: No virtual method toString(Z)Ljava/lang/String; in class Lokhttp3/Cookie; or its super classes

ericklemus avatar Sep 23 '21 17:09 ericklemus

We are also facing the same issue, getting an undefined response while I am checking on Android but it works for iOS.

VersionCheck.needUpdate() .then(async res => { console.log(res.isNeeded); // true if (res.isNeeded) {} });

sivaramakrishnac avatar Feb 25 '22 07:02 sivaramakrishnac

Hi, I am also facing same issue react-native-version-check ^3.4.1 Tried this VersionCheck.needUpdate({ country: 'eg' }) but still not working. Thanks.

SupriyaKamat avatar Feb 25 '22 07:02 SupriyaKamat

@nikesh8 @sureshhallyali

Found any solution?

sivaramakrishnac avatar Feb 25 '22 07:02 sivaramakrishnac

  1. react-native link
  2. Close metro server
  3. uninstall app
  4. clean project
  5. reinstall app works for me

usmanrwp avatar May 19 '22 23:05 usmanrwp

facing the same issue

Zakyyy avatar Jul 06 '22 11:07 Zakyyy

Same issue here, is there any chance to get this working on android?

ghiculescualexandru avatar Aug 08 '22 11:08 ghiculescualexandru

@nikesh8 @sureshhallyali

Found any solution?

Not Yet. Still looking for a solution.

nikesh8 avatar Aug 23 '22 10:08 nikesh8

same problem, how fix it??

bodrius avatar Sep 02 '22 05:09 bodrius