Sorry i'm a baby dev and i'm confused by using Xcode for push my app on AppStore.
I try to put the .jsbundle of my app to build the application and send it to the stores.I followed the open classroom tutorial to do this.(here)
I've generated the javascript bundle and assets - it's okay, the problem is in its use afterwards. I don't have a JsCodeLocation
in my AppDelegate
, but Bridge.
It seems to do the same thing, indicating if it's in Debug mode to go through the index, if not to fetch the jsbundle.But when I run in release it crashes and gives me the error :
" No bundle URL present. Make sure you're running a packager server or have included a .jsbundle file in your application bundle."error crash on Xcode
I show you the content of my app.delegate :
#import "AppDelegate.h"#import <React/RCTBridge.h>#import <React/RCTBundleURLProvider.h>#import <React/RCTRootView.h>#import <React/RCTLinkingManager.h>#import "RNSplashScreen.h"@implementation AppDelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"watiz" initialProperties:nil]; rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootViewController = [UIViewController new]; rootViewController.view = rootView; self.window.rootViewController = rootViewController; [self.window makeKeyAndVisible]; [RNSplashScreen show]; return YES;}- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge{#if DEBUG return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];#else return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];#endif}- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options{ return [RCTLinkingManager application:application openURL:url options:options];}- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler{ return [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler];}@end
I've tried different things but nothing works, i don't know why it doesn't get the main.jsbundle
Do you have an idea ?thank you in advance !