看起来__DEV__的实现已经改变了。更新 - [RCTBatchedBridge loadSource:]

时间:2015-12-02 16:57:37

标签: javascript ios react-native

当我尝试准备我的react本机应用程序以在应用程序终止的设备上运行时出现以下错误,我无法弄清楚。我已经读过节点需要是版本+4但我运行4.1.2所以我不认为这样。有任何想法吗?

TutorMeNow[81429:1527409] *** Assertion failure in __31-[RCTBatchedBridge loadSource:]_block_invoke(), /Users/spencerpope/Tutor2/node_modules/react-native/React/Base/RCTBatchedBridge.m:204
2015-12-02 11:50:11.274 TutorMeNow[81429:1527409] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'It looks like the implementationof __DEV__ has changed. Update -[RCTBatchedBridge loadSource:].'
  *** First throw call stack:
 (
 0   CoreFoundation                      0x0000000102574f45  __exceptionPreprocess + 165
1   libobjc.A.dylib                     0x0000000101776deb     objc_exception_throw + 48
2   CoreFoundation                      0x0000000102574daa +   [NSException raise:format:arguments:] + 106
3   Foundation                          0x00000001013c36b2 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 169
4   TutorMeNow                          0x000000010038ad3d __31-[RCTBatchedBridge loadSource:]_block_invoke + 861
5   TutorMeNow                          0x00000001003723e3 __50+[RCTJavaScriptLoader loadBundleAtURL:onComplete:]_block_invoke + 195
6   libdispatch.dylib                   0x0000000104e84e5d _dispatch_call_block_and_release + 12
7   libdispatch.dylib                   0x0000000104ea549b _dispatch_client_callout + 8
8   libdispatch.dylib                   0x0000000104e8dbef _dispatch_root_queue_drain + 1829
9   libdispatch.dylib                   0x0000000104e8d4c5 _dispatch_worker_thread3 + 111
10  libsystem_pthread.dylib             0x00000001051d64f2 _pthread_wqthread + 1129
11  libsystem_pthread.dylib             0x00000001051d4375 start_wqthread + 13
 )
 libc++abi.dylib: terminating with uncaught exception of type NSException
 (lldb) 

2 个答案:

答案 0 :(得分:0)

尝试在AppDelegate(iOS)中将打包器网址更新为http://localhost:8081/index.ios.bundle?platform=ios&dev=true

答案 1 :(得分:0)

按照升级指南,“手动更改”部分为我解决了这个问题:http://facebook.github.io/react-native/docs/upgrading.html

需要添加一个新的Run Script阶段: enter image description here

enter image description here

然后需要删除main.jsbundle文件: enter image description here

不再需要main.jsbundle。在XCode中选择您的设备作为目标,然后点击运行按钮在设备上部署/运行。