
my rn is 0.32;code-push is 1.14.6 beta,thx
Could you try running react-native link react-native-code-push instead of rnpm link?
I got the same issue. Turned out you have to put jsCodeLocation = [CodePush bundleURL]; into the AppDelegate.m. Anywhere else will cause this issue.
Hi @joeytat, @fanyuRN, @Lughino - I am investigating this now and would really appreciate your input. The linking script looks for the following lines (or similar) in AppDelegate.m in order to patch them for CodePush, and appears to be unable to find them:
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"DummyApp"
initialProperties:nil
launchOptions:launchOptions];
Can I ask if you have these lines in some other file (if so, which)? Was your app created from scratch with React Native, or are you integrating RN into an app that was originally built natively?
@silhouettes
1) Yes, I thought keep AppDelegate.m neat is nice. so I put those code in another file called 'XXRNManager'.
2) Integration with existing native app.
Hi @silhouettes
Thanks, this is really helpful.
@Lughino - Did you have a jsCodeLocation = ... line in your AppDelegate.m originally, before you ran react-native link? Is it possible you had multiple AppDelegate.m files, for example if there was a sample app embedded in your repo somewhere?
@silhouettes - Yes, that line of code is present in the AppDelegate.m before launching react-native link.
I also verified by creating a project from scratch with no external dependencies and no multiple AppDelegate.m in any project folder.
I hope I was helpful
@fanyuRN why you closed this issue?
oh , should I reopen?
It was marked as "investigating" and close it seems that it is resolved.
I saw that you opened a new issue that just complains about the same thing.
Open new issue does not resolve the problem in less time, indeed it slows putting just confusing!
oh,I am sorry,
It seems like there are two sources of error here:
jsCodeLocation = ... line failed to match newlines correctly (on Windows?) - @Lughino's PR to fix this has been merged into master, thank you!AppDelegate.m - I will consider adding some fallback logic to ask the user which file the line is in, or to specify manual install instructions.postlink.js to handle missing AppDelegate.m and reports a meaningful message with link to manual installation section in README