React Native (on 0.35) app fails to pick up offline bundle on my local machine OR build with the new RCTBundleURLProvider snippet.
This is running in the "Release" scheme.
When trying to load the offline bundle (command react-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output iOS/main.jsbundle), it spits out:
2016-10-13 16:59:08.489 [fatal][tid:main] No script URL provided. Make sure the packager is running or you have embedded a JS bundle in your application bundle.unsanitizedScriptURLString:((null))
The bundle is in the correct directory and is in the XCode project. I am correctly signing the app w/ fastlane under the correct appstore provisioning profiles.
Two different AppDelegate snippets I have tried:
#ifdef DEBUG
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
#else
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
I would expect it to build successfully. With the first AppDelegate snippet posted above, it correctly loads in the "Debug" scheme.
I began to experience this issue today, seemingly out of nowhere. Have you found a solution @arjunblj?
Yes, I just solved this issue. For some reason, the meta file was not included.
Yes, please, I have this problem also. What is the meta file?
Seeing this as well working with the CLI. @arjunblj could you share your solution?
Don't know if this will help anyone but this was driving me nuts and the following worked for me . . .
At this point I got a new error, one of my modules had the same name as one of the in-built RN modules. So I renamed that and it all worked.
I have encountered exactly with the same problem, Any help please!
React Native version: 0.39.2
Platform: iOS
Operating System: macOS
Xcode: 8.0
@pan100 and for whoever else finds this - meta file is when you run
react-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output ./ios/release/main.jsbundle --assets-dest ./ios/release/main.jsbundle
it will generate both a main.jsbundle and main.jsbundle.meta file
I had the same problem with React Native 0.42 when integrating it in an existing iOS/swift app.
Solved in this way:
Most helpful comment
Seeing this as well working with the CLI. @arjunblj could you share your solution?