Closed mununki closed 9 months ago
I have the exact same issue.
Did you ever have expo-updates
installed?
I have the exact same issue.
Did you ever have
expo-updates
installed?
No, I'm not using expo. It is configured with react-native-cli.
I finally fix this issue.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
...
NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:self.moduleName
initialProperties:self.initialProps
launchOptions:launchOptions];
...
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
...
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
I suspect the cause of the issue is that it creates a new rootView again during the process of checking for codepush updates, downloading the latest jsbundle, and installing it, causing an interruption in the middle. So I made the following modification and codepush update installed normally and works as intended.
RCTRootView rootView
that is already done inside super- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[super application:application didFinishLaunchingWithOptions:launchOptions];
# NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
# RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
# moduleName:self.moduleName
# initialProperties:self.initialProps
# launchOptions:launchOptions];
# self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
# UIViewController *rootViewController = [UIViewController new];
# rootViewController.view = rootView;
# self.window.rootViewController = rootViewController;
# [self.window makeKeyAndVisible];
...
return YES;
}
Can you share the full snippet of AppDelegate.mm please.
pls check this i had this issue which was solved. https://github.com/microsoft/react-native-code-push/issues/2529#issuecomment-1968788585
Every updates are not installed and keep rolled back or throwing an exception on iOS. I started facing this issue after upgrading RN 0.68.7 -> 0.72.7 and code-push 7.1.0 -> 8.1.0.
Steps to Reproduce
Expected Behavior
The update is installed
Actual Behavior
The update keeps rolled back, not installed on iOS. AOS is fine. I observed symptoms in two cases. It works fine on the previous versions.
1. Auto update
This case cause the exception when I ran the app through the xcode to get an error stack.
Thread 3: "Error when sending event: CodePushDownloadProgress with body: {\n receivedBytes = 8914917;\n totalBytes = 8914917;\n}. RCTCallableJSModules is not set. This is probably because you've explicitly synthesized the RCTCallableJSModules in CodePush, even though it's inherited from RCTEventEmitter."
2. Manual update
This case doesn't cause the exception, but the sync call is not working as intended. When the sync is called, it logs
Even if you check the app center dashboard, all updates are rolled back and not installed.
Reproducible Demo
Environment