react-native-restart icon indicating copy to clipboard operation
react-native-restart copied to clipboard

TypeError: Cannot read property 'restart' of null

Open kbqdev opened this issue 2 years ago • 6 comments

React native : 0.72.4 react-native-restart: 0.0.27

WARN Possible Unhandled Promise Rejection (id: 0): TypeError: Cannot read property 'restart' of null TypeError: Cannot read property 'restart' of null

kbqdev avatar Sep 10 '23 10:09 kbqdev

I do have the same issue, Has anyone with any solution helped?

spideyinf avatar Oct 14 '23 16:10 spideyinf

I also had this issue earlier, but after restarting the bundler and rebuilding the app it went away.

bviebahn avatar Oct 16 '23 08:10 bviebahn

Have the same issue. Rebuilding the bundle did not help.

master12 avatar Oct 25 '23 18:10 master12

Make sure rebuilding your app after installing react-native-restart It will not work in Expo Go

You can create a development build which is like a custom version of Expo Go. It won't work in Expo Go, because it includes native code, and that native code is not built into Expo Go. (And can't be added later.) So you need to build your app. e.g.:

eas build -p android --profile development

Then install that on your device/emulator and use it instead of Expo Go.

bilalaurangzebkhan avatar Dec 25 '23 18:12 bilalaurangzebkhan

Make sure rebuilding your app after installing react-native-restart It will not work in Expo Go

You can create a development build which is like a custom version of Expo Go. It won't work in Expo Go, because it includes native code, and that native code is not built into Expo Go. (And can't be added later.) So you need to build your app. e.g.:

eas build -p android --profile development

Then install that on your device/emulator and use it instead of Expo Go.

Thanks @bilalaurangzebkhan. This explanation should be in README.. Does this mean if we install it via npm / yarn add react-native-restart, create a dev-build, that's it? No need for any of that linking stuff?

ansmlc avatar Apr 16 '24 21:04 ansmlc

Make sure rebuilding your app after installing react-native-restart It will not work in Expo Go You can create a development build which is like a custom version of Expo Go. It won't work in Expo Go, because it includes native code, and that native code is not built into Expo Go. (And can't be added later.) So you need to build your app. e.g.: eas build -p android --profile development Then install that on your device/emulator and use it instead of Expo Go.

Thanks @bilalaurangzebkhan. This explanation should be in README.. Does this mean if we install it via npm / yarn add react-native-restart, create a dev-build, that's it? No need for any of that linking stuff?

Yes @ansmlc the newer version does auto-linking. and the react-native-restart will not work on expo Go but will work fine for development and production build.

bilalaurangzebkhan avatar May 11 '24 15:05 bilalaurangzebkhan