kimxogus / react-native-version-check

A version checker for react-native applications
MIT License
722 stars 177 forks source link

Incompatibility with @expo/config-plugins version 7.3.1 and Expo 50 requirement #221

Open savayer opened 8 months ago

savayer commented 8 months ago

The issue detected by npx expo-doctor@latest

Check Expo config for common issues ✔ Check package.json for common issues ✔ Check dependencies for packages that should not be installed directly ✔ Check for common project setup issues ✔ Check for issues with metro config ✔ Check npm/ yarn versions ✔ Check Expo config (app.json/ app.config.js) schema ✔ Check that native modules do not use incompatible support packages ✔ Check for legacy global CLI installed locally ✖ Check that native modules use compatible support package versions for installed Expo SDK ✔ Check that packages match versions required by installed Expo SDK

Detailed check results:

Expected package @expo/config-plugins@~7.8.0 Found invalid: @expo/config-plugins@7.3.1 (for more info, run: npm why @expo/config-plugins) Advice: Upgrade dependencies that are using the invalid package versions and remove resolutions from package.json that are pinning @expo/config-plugins to an invalid version.

One or more checks failed, indicating possible issues with the project.

KesoGizmoYoshi commented 7 months ago

Strange i can use this library with @expo/config-plugins@~7.8.0 and expo@50.0.14

tymoxx commented 6 months ago

Strange i can use this library with @expo/config-plugins@~7.8.0 and expo@50.0.14

do you get all checks when you run npx expo-doctor?

purushottam-e9 commented 5 months ago

@tymoxx @KesoGizmoYoshi @savayer any luck here?

tymoxx commented 5 months ago

I decided to get rid of the react-native-version-check library and to keep the latest released version manually in the repo file. Then the app just makes a request to read latest version and compare it with the currently installed version.

savayer commented 5 months ago

I also got rid of this package and just use this, works ok for me

dominik-mrugalski commented 1 month ago

We also had a problem with that (ReactNative Expo app, latest ExpoSDK), but it works after some improvements. It looks like this plugin can't read information from expo setting directly, and it throws an error. I've just passed this 3 values as params to needUpdate function and it works fine for us.

VersionCheck.needUpdate({
        currentVersion: Constants?.expoConfig?.version, // ex: "1.0.3"
        country: "US",
        packageName: Constants?.expoConfig?.extra?.packageName,  // ex: "com.yourpackage.app"
      }).then(async (res) => {
        if (res.isNeeded) {
             // Do what you want here (show modal, disable app or any other action)
        }
      });

Remember you need to have this app already released in the stores, to be able to check versions from stores. Second important fact is that you need to pass proper package name. We have two targets (dev and prod) and only with a valid packageName (from production config) will it return the correct response!