How to create a React Native App for iPhone?

Everything works fine on the iPhone simulator. When creating an iPhone app, I get an error:

To create an RCTRootView

url bundle required.

In AppDelegate.m, I will uncomment the following line:

jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

And upload the prebuild main.jsbundle file to the iOS folder in the project root:

curl http://localhost:8081/index.ios.bundle -o main.jsbundle
+4
source share
1 answer

I forgot to add the file to the project.

You need to right-click on the project name and select "Add Files to MyProject ..." . Then select main.jsbundle . Create a project and it should work.

+10
source

All Articles