-
Notifications
You must be signed in to change notification settings - Fork 66
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
TypeError: Invalid Version:null when versionCode is over 1000 #176
Comments
If I were you I'd experiment with implementing both Let's start there. |
OK, I did some testing as you suggersted. Here is my code just for testing const checkForUpdate = async (appVersion: string, androidUpdateType = AndroidUpdateType.FLEXIBLE) => { As you can see I am not giving app version for the library and let it handle it. Store will return versionCode and client is using versionName for comparison. I was also earlier following guides and giving it DeviceInfo.getVersion() which seems to be the wrong info to give to the comparator. After I manually give Android Build number (with DeviceInfo.getBuildNumber()) I can see that it's at least trying to compare the same thing. How have others not ran into this problem? |
@timokauppinen |
I stopped testing after I got it working correctly by using build number comparison instead, I have customVersionComparator. Maybe it's something to do with "semver" library used, but anyway I still think it's comparing wrong things as in default it's comparing RNDeviceInfo.appVersion and versionCode (build number) it gets from backend, those are not same thing. |
Hello,
My app latest versionCode is 1010 and sp-react-native-in-app-updates works well when versionCode is 998 (or any other number under 1000). When I install app with versionCode 1000 then it will give error
"sp-react-native-in-ap-updates checkNeedsUpdate error: TypeError: Invalid Version: null"
I have been testing this with internal app sharing and the update will consistently depend less of target app versionCode -as long as there is update available. As long as installed versionCode is higher than 1000, for example 3000 and target versionCode is 4000 it will give this error.
The text was updated successfully, but these errors were encountered: