Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
132 views
in Technique[技术] by (71.8m points)

android - No Bundle URL Found - React Native Getting Started

I am following the steps at React Native Getting Started and I am unable to get the application running. When I run cd /Users/brandonsmac/SysDevMobileApps/ReactNative/AwesomeApp" && npx react-native run-ios

It will say successfully built, but when I got to view the screen it says "Bundle URL Missing"

I notice there is the following post that I tried react-native No bundle URL present and I still get the error.

Also, I can show what happens when I run it with the expo but that fails as well.

Can someone please help me?

question from:https://stackoverflow.com/questions/65920458/no-bundle-url-found-react-native-getting-started

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The answer I found here worked. https://onexlab-io.medium.com/no-bundle-url-present-fixed-ca2688a80f66

Step 1:

  • Open the package.json file and add the following line '"build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='iOS'"'
  • Now your file looks like this following screenshot

[Step 1][

Step 2:

  • Run following command. It will generate main.jsbundle file

    yarn build:ios or npm run build:ios

Step 3:

  • Open iOS project in Xcode show as following screenshot

Step 3 Part 1

  • Select -> Target → Build Phases under Copy Bundle Resources click on the plus button as following screenshot.

Step 3 Part 2

  • It will show you the prompt as shown below. Then select the file main.jsbundle and click on the Add button

Step 3 Part 3

Step 4:

Try to re-run your app

npx react-native run-ios
or
react-native run-ios

Step 5:

TA DA!! Step 5 Complete


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...