Skip to content
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

Android: Error: sp-react-native-in-app-updates checkNeedsUpdate error: Error: com.google.android.play.core.install.InstallException #185

Open
serhii-yalla opened this issue Aug 12, 2024 · 3 comments

Comments

@serhii-yalla
Copy link

[Error: sp-react-native-in-app-updates checkNeedsUpdate error: Error: com.google.android.play.core.install.InstallException: -6: Install Error(-6): The download/install is not allowed, due to the current device state (e.g. low battery, low disk space, ...). (https://developer.android.com/reference/com/google/android/play/core/install/model/InstallErrorCode#ERROR_INSTALL_NOT_ALLOWED)]

@serhii-yalla
Copy link
Author

Here is part of code where it happens

useEffect(() => {
    const timeout = setTimeout(async () => {
      const navigate = (result?: NeedsUpdateResponse) => {
        appLocalStorage.baseUrl.get().then((baseUrl) => {
          appLocalStorage.authToken.get().then((authToken) => {
            appLocalStorage.deviceID.get().then(async (deviceID) => {
              if (result?.shouldUpdate) {
                navigation.reset({
                  // @ts-ignore
                  index: 0,
                  routes: [{ name: AUTH_NAVIGATION_SCREENS.NEW_VERSION }]
                });
              } else if (baseUrl === null || authToken === null || deviceID === null) {
                navigation.reset({
                  // @ts-ignore
                  index: 0,
                  routes: [{ name: AUTH_NAVIGATION_SCREENS.AUTHENTICATION }]
                });
              } else {
                navigation.reset({
                  // @ts-ignore
                  index: 0,
                  routes: [{ name: AUTH_NAVIGATION_SCREENS.LOGIN }]
                });
              }
            });
          });
        });
      };

      try {
        const result = await inAppUpdates.checkNeedsUpdate();
        navigate(result);
      } catch (error) {
        console.log(error);
        Sentry.captureMessage("ERROR. sp-react-native-in-app-updates", {
          extra: {
            error
          }
        });
        navigate();
      }
    }, SPLASH_SCREEN_MS_LATENCY);

    return () => clearTimeout(timeout);
  }, [navigation]);

@serhii-yalla
Copy link
Author

serhii-yalla commented Aug 12, 2024

Suppose that happens only on emulator devices

@lutfi-haslab
Copy link

Duplication Issue: #41
I have the same problem as you. My solution was to upload a lower version (0.5.2 in my case) to Internal Testing, then install version 0.5.2. Make a release for the newer version 0.5.3, and upload it again to Internal Testing. Now open the app; the update modal should be showing.

You can't install release app directly to your device.

Screenshot 2024-08-21 at 16 36 12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants