When I try to build my React Native App from XCode
in Release mode
to check before launch it to production it get stuck in old code. No matter what change I do in my JS file that it won't do it. In Debug mode it doesn't happen, just works fine like it should.
Example:
I change a label in any of my JS files like a title of some menu and it will work when I use react-native run-ios
or if I press on "Play" button of XCode if in the scheme "Debug" is checked. If instead, I check "Release" it charge an old version of my app I don't even know with certainly which version is.
I have tried to launch to production but still being the old version.
So, now a day I can't upload new version due to no matter what changes I do, the release mode ignores it.
I have tried to generate a new main.jsbundle
, I have cleaned build with Shift + CMD + K
and I aso have reinstalled my npm
with no solution.
Do you have any idea?
EDIT:
Does the file "AppDelegate.m" have anything to do with it?
This is my AppDelegate:
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.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:@"BottomNavigation"
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];
return YES;
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
@end