What is the meaning of 'No bundle URL present' in react-native?

前端 未结 30 2125
庸人自扰
庸人自扰 2020-11-30 17:22

When I run a react-native project, I get a error no bundle URL present , but I don\'t know what mistakes I do, I was very confused.

相关标签:
30条回答
  • 2020-11-30 17:25

    For me the issue was it couldn't create the JS bundle. It doesn't state the error when building from Xcode so there is no way for you to know this. To find the error run the following command.

    react-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output ./ios/release/main.jsbundle --assets-dest ./ios/release/main.jsbundle

    For me the error was something with missing PureRenderMixin component. To which the solution can be found here: https://github.com/facebook/react-native/issues/13078. Basicly you have to manually install react@16.0.0-alpha.3. This can be done via running this command.

    npm i --save react@16.0.0-alpha.3

    This issue is now happening for everybody because newer versions of react alphas are being released (particularly alpha.5) and they are breaking react-native builds.

    0 讨论(0)
  • 2020-11-30 17:25

    I had this same issue. But my problem was my Mac and iPhone were not in same wifi network.

    So ensure that they are all in same network and rebuild once again. If this is not the case, try the solutions mentioned by other members here.

    0 讨论(0)
  • 2020-11-30 17:27

    following these steps:

    • open ios file project with xcode
    • in project bundle delete main.jsbundle file
    • add new empty file by main.jsbundle name
    • Run comment: react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
    • now react-native run-ios

    youtube link: https://www.youtube.com/watch?v=eCs2GsWNkoo

    0 讨论(0)
  • 2020-11-30 17:27

    In my case the problem was fixed by restarting the adb server: adb kill-server && adb start-server

    0 讨论(0)
  • 2020-11-30 17:27

    make sure you have .jsbundle in your your project

    Add

    react-native bundle --dev false --entry-file index.js --bundle-output ios/main.jsbundle --platform ios
    

    in your react native code try to reopen the project

    0 讨论(0)
  • 2020-11-30 17:28

    This is an issue with react-native v0.42.1. Try to close all terminal and XCode instances and run:

    launchctl unload ~/Library/LaunchAgents/com.github.facebook.watchman.plist
    watchman version
    react-native run-ios
    
    0 讨论(0)
提交回复
热议问题