i'm trying to integrate react native project into existing iOS app with this tutorial and everything were fine and i was managed to run the iOS app but after few tries with different project, the iOS app give me error below
2019-11-05 17:30:51.901 [info][tid:main][RCTCxxBridge.mm:236] Initializing <RCTCxxBridge: 0x7fc003600000> (parent: <RCTBridge: 0x600001845260>, executor: (null))
2019-11-05 17:30:51.902302+0800 JD_SDK[18656:187123] Initializing <RCTCxxBridge: 0x7fc003600000> (parent: <RCTBridge: 0x600001845260>, executor: (null))
2019-11-05 17:30:51.927 [info][tid:main][RCTRootView.m:293] Running application TestProject ({
initialProps = {
};
rootTag = 1;
})
2019-11-05 17:30:51.927406+0800 JD_SDK[18656:187123] Running application TestProject\^Q ({
initialProps = {
};
rootTag = 1;
})
2019-11-05 17:30:52.007 [info][tid:com.facebook.react.JavaScript] Running application "TestProject" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === false, development-level warning are OFF, performance optimizations are ON
2019-11-05 17:30:52.007524+0800 JD_SDK[18656:187288] Running application "TestProject\^Q" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === false, development-level warning are OFF, performance optimizations are ON
2019-11-05 17:30:52.008 [error][tid:com.facebook.react.JavaScript] Application TestProject has not been registered.
Hint: This error often happens when you're running the packager (local dev server) from a wrong folder. For example you have multiple apps and the packager is still running for the app you were working on before.
If this is the case, simply kill the old packager instance (e.g. close the packager terminal window) and start the packager in the correct app folder (e.g. cd into app folder and run 'npm start').
This error can also happen due to a require() error during initialization or failure to call AppRegistry.registerComponent.
2019-11-05 17:30:52.008503+0800 JD_SDK[18656:187288] Application TestProject\^Q has not been registered.
Hint: This error often happens when you're running the packager (local dev server) from a wrong folder. For example you have multiple apps and the packager is still running for the app you were working on before.
If this is the case, simply kill the old packager instance (e.g. close the packager terminal window) and start the packager in the correct app folder (e.g. cd into app folder and run 'npm start').
This error can also happen due to a require() error during initialization or failure to call AppRegistry.registerComponent.
2019-11-05 17:30:52.011 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Application TestProject has not been registered.
Hint: This error often happens when you're running the packager (local dev server) from a wrong folder. For example you have multiple apps and the packager is still running for the app you were working on before.
If this is the case, simply kill the old packager instance (e.g. close the packager terminal window) and start the packager in the correct app folder (e.g. cd into app folder and run 'npm start').
This error can also happen due to a require() error during initialization or failure to call AppRegistry.registerComponent.
2019-11-05 17:30:52.011177+0800 JD_SDK[18656:187250] Unhandled JS Exception: Application TestProject\^Q has not been registered.
Hint: This error often happens when you're running the packager (local dev server) from a wrong folder. For example you have multiple apps and the packager is still running for the app you were working on before.
If this is the case, simply kill the old packager instance (e.g. close the packager terminal window) and start the packager in the correct app folder (e.g. cd into app folder and run 'npm start').
This error can also happen due to a require() error during initialization or failure to call AppRegistry.registerComponent.
2019-11-05 17:30:52.014618+0800 JD_SDK[18656:187123] -[AppDelegate window]: unrecognized selector sent to instance 0x600003154200
2019-11-05 17:30:52.015 [info][tid:com.facebook.react.JavaScript] 'BugReporting extraData:', { 'AppRegistry.runApplication1': 'Running application "TestProject\u0011" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === false, development-level warning are OFF, performance optimizations are ON' }
2019-11-05 17:30:52.026262+0800 JD_SDK[18656:187288] 'BugReporting extraData:', { 'AppRegistry.runApplication1': 'Running application "TestProject\u0011" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === false, development-level warning are OFF, performance optimizations are ON' }
2019-11-05 17:30:52.026869+0800 JD_SDK[18656:187123] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AppDelegate window]: unrecognized selector sent to instance 0x600003154200'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23c4f02e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff50b97b20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23c6ff94 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 UIKitCore 0x00007fff4787df59 -[UIResponder doesNotRecognizeSelector:] + 302
4 CoreFoundation 0x00007fff23c53b56 ___forwarding___ + 838
5 CoreFoundation 0x00007fff23c55f38 _CF_forwarding_prep_0 + 120
6 JD_SDK 0x0000000101c0411d -[RCTRedBoxWindow bottomSafeViewHeight] + 125
7 JD_SDK 0x0000000101c027ff -[RCTRedBoxWindow initWithFrame:] + 623
8 JD_SDK 0x0000000101c076a4 __55-[RCTRedBox showErrorMessage:withParsedStack:isUpdate:]_block_invoke + 468
9 libdispatch.dylib 0x0000000102ab3dd4 _dispatch_call_block_and_release + 12
10 libdispatch.dylib 0x0000000102ab4d48 _dispatch_client_callout + 8
11 libdispatch.dylib 0x0000000102ac2de6 _dispatch_main_queue_callback_4CF + 1500
12 CoreFoundation 0x00007fff23bb1df9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
13 CoreFoundation 0x00007fff23baca59 __CFRunLoopRun + 2329
14 CoreFoundation 0x00007fff23babe16 CFRunLoopRunSpecific + 438
15 GraphicsServices 0x00007fff38438bb0 GSEventRunModal + 65
16 UIKitCore 0x00007fff4784fb68 UIApplicationMain + 1621
17 JD_SDK 0x0000000101ac67ad main + 125
18 libdyld.dylib 0x00007fff51a1dc25 start + 1
19 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
This is the code in my ViewController.m
#import "ViewController.h"
#import <React/RCTRootView.h>
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (IBAction)highScoreButtonPressed:(id)sender {
NSURL *jsCodeLocation = [[NSBundle mainBundle] URLForResource: @"main" withExtension:@"jsbundle"];
RCTRootView *rootView =
[[RCTRootView alloc] initWithBundleURL: jsCodeLocation
moduleName: @"TestProject"
initialProperties: nil
launchOptions: nil];
UIViewController *vc = [[UIViewController alloc] init];
vc.view = rootView;
[self presentViewController:vc animated:YES completion:nil];
}
@end
The module name, "TestProject" is definitely same with the app name of the react native project. Any idea what is going wrong?