React Native App crashes on Launch Screen on device

前端 未结 6 1938
轮回少年
轮回少年 2021-02-05 12:50

I\'m starting with React Native, everything works fine in the iOS simulator. I decide to try it on a device.

The app launches, I can play with it, I close/reopen it arou

相关标签:
6条回答
  • 2021-02-05 13:22

    I had a similar issue. My application crashed on emulator device every time I ran the application without throwing any error in the console.

    Here are a bunch of solutions that might work:

    Solution 1 Remove node_modules

    rm -rf /node_modules
    npm install
    

    Solution 2 Remove /android/app/build directory (This one worked for me)

    rm -rf /android/app/build
    

    After this, uninstall the application from emulator device and then run your application again

    0 讨论(0)
  • 2021-02-05 13:24

    I had this problem also, what triggered it for me though was updating react and react-native.

    I did a build after updating and then I experienced the same issue. I downgraded back to the previous versions of react and react-native, but that didn't work for me.

    I tried removing node modules, and reinstalling, that didn't help. Then I noticed that when I was building: react-native run-ios,

    the files in ios/build were not updating

    I rm -rf ios/build/ and then I react-native run-ios and the ios/build folder populated. My app ran fine after that.

    0 讨论(0)
  • 2021-02-05 13:32

    I was also facing the same issue on real device and it was working fine on simulator. So, i have fixed my issue by given solution

    Solution: i have uninstall the application from simulator and then installed it again. This time it showed me the actual error on simulator that i had made mistake.

    0 讨论(0)
  • 2021-02-05 13:37

    I came across this issue today. Read a few SO posts and saw one guy mentioned if your app launches and hangs on the splash screen and then crashes with no error it probably has something to one of your npm dependencies.

    After digging deeper i saw the react packager was throwing the error

    This error is caused by a @providesModule declaration with the same name across two different files.

    To fix

    1. check / clean up dependencies(check for same name declerations)

    2. rm -rf node_modules

    3. rm -rf $TMPDIR/react-*

    4. npm i

    0 讨论(0)
  • 2021-02-05 13:38

    For me lottie package was creating problem. After removing the package able to launch the package.

    Make sure by checking the last package/packages installed

    0 讨论(0)
  • 2021-02-05 13:42

    This can caused by many issues it seems. Recently this happened to me and I had to search a bit to find out the exact reason. I'll save you guys the trouble by sharing few places I read - https://github.com/facebook/react-native/issues/14500#issuecomment-348063910 - https://github.com/facebook/react-native/issues/17276#issuecomment-357538208

    In my case it was a library issue which I have not linked properly.

    -https://github.com/ivpusic/react-native-image-crop-picker/issues/204

    So yeah! my point is, it's something we have done or not done. Bit more research would help!!!

    0 讨论(0)
提交回复
热议问题