Reputation: 7575
I pulled a React Native project from github and attempted to do react-native run-ios
but I got the following error:
What could be causing this problem?
Thank you
Upvotes: 0
Views: 1031
Reputation: 32392
In RN versions < .30 this error sometimes comes up when you try to run the app in development/debug mode in xcode but use the release jsLocation
line in AppDelegate.m
(i.e. the offline bundle).
The solution is to use the development jsLocation
and comment out the prod jsLocation
or just upgrade RN to a version >= .30 where you no longer have to manually specify the dev/release jsLocation
.
RN version < 0.30 - AppDelegate.m
Comment this line
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
Uncomment this line
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
Upvotes: 3