App crashes on launch after building an apk
See original GitHub issueDuring development the package worked perfectly well but after building it using expo build, it crashes on launch. How do I resolve this?
Package used: react-native-version-checker-expo
Package version: ^3.4.2
Method of Usage:
I import the package using import VersionCheck from 'react-native-version-check-expo'
. Then, placed the lines below in my App.js file
useEffect(() => {
VersionCheck.needUpdate().then(async (res) => {
if (res && res.isNeeded) {
return Alert.alert(
"New App Update!",
`There is a new version. Kindly update now to enjoy the best experience.\n\nSelect 'OK' to open the Play Store.`,
[
{ text: "Cancel", style: "cancel" },
{ text: "OK", onPress: () => Linking.openURL(res.storeUrl) }, // open store
],
{ cancelable: false }
);
}
});
}, []);
I get this error when I hover on the imported package:
Could not find a declaration file for module ‘react-native-version-check-expo’. ‘c:/dev/ecomobile/node_modules/react-native-version-check-expo/index.js’ implicitly has an ‘any’ type.
Try npm i --save-dev @types/react-native-version-check-expo
if it exists or add a new declaration (.d.ts) file containing declare module 'react-native-version-check-expo';
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top GitHub Comments
12
alternatively for react-native-version-check you can try to use
To make sure the check if not fired directly when the app mounts, that seems to have fixed the issue on ios for us.