ios - 我无法在 ios Xcode 上运行我的 react-native 应用程序

标签 ios xcode react-native react-native-ios

我在运行我的 react-native ios 应用程序时遇到了一个真正的问题。我安装了 Xcode(版本 8.3.3)和所有其他所需的基本依赖项,我所做的就是:

    react-native init AwesomeProject
    cd AwesomeProject
    react-native run-ios

AwesomeProject 应用打开一秒钟然后关闭。我也尝试通过 xcode 运行它并遇到同样的问题,尽管它至少报告了以下错误:

2017-09-04 20:38:11.369 [info][tid:main][RCTCxxBridge.mm:188] 

Initializing <RCTCxxBridge: 0x6000001a0540> (parent: <RCTBridge: 0x6000000a9a20>, executor: (null))
2017-09-04 20:38:11.390 [warn][tid:main][RCTBridge.m:114] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2017-09-04 20:38:11.404 [info][tid:main][RCTRootView.m:301] Running application AwesomeProject ({
    initialProps =     {
    };
    rootTag = 1;
})
2017-09-04 20:38:11.467 AwesomeProject[10363:1261593] -[NSTaggedPointerString unsignedIntValue]: unrecognized selector sent to instance 0xa383534303930327
2017-09-04 20:38:11.509 AwesomeProject[10363:1261593] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString unsignedIntValue]: unrecognized selector sent to instance 0xa383534303930327'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010e4f4b0b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x000000010d3aa141 objc_exception_throw + 48
    2   CoreFoundation                      0x000000010e564134 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
    3   CoreFoundation                      0x000000010e47b840 ___forwarding___ + 1024
    4   CoreFoundation                      0x000000010e47b3b8 _CF_forwarding_prep_0 + 120
    5   AwesomeProject                      0x000000010c7653f4 -[RCTMultipartStreamReader emitProgress:contentLength:final:callback:] + 244
    6   AwesomeProject                      0x000000010c765bea -[RCTMultipartStreamReader readAllPartsWithCompletionCallback:progressCallback:] + 1610
    7   AwesomeProject                      0x000000010c7b551c -[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:] + 444
    8   CFNetwork                           0x000000010df54c51 __88-[NSURLSession delegate_streamTask:didBecomeInputStream:outputStream:completionHandler:]_block_invoke + 51
    9   Foundation                          0x000000010ceb43b7 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
    10  Foundation                          0x000000010ceb40bb -[NSBlockOperation main] + 101
    11  Foundation                          0x000000010ceb2877 -[__NSOperationInternal _start:] + 627
    12  Foundation                          0x000000010ceae5fc __NSOQSchedule_f + 198
    13  libdispatch.dylib                   0x00000001121d605c _dispatch_client_callout + 8
    14  libdispatch.dylib                   0x00000001121b494f _dispatch_queue_serial_drain + 221
    15  libdispatch.dylib                   0x00000001121b5669 _dispatch_queue_invoke + 1084
    16  libdispatch.dylib                   0x00000001121b7ec4 _dispatch_root_queue_drain + 634
    17  libdispatch.dylib                   0x00000001121b7bef _dispatch_worker_thread3 + 123
    18  libsystem_pthread.dylib             0x000000011256d5a2 _pthread_wqthread + 1299
    19  libsystem_pthread.dylib             0x000000011256d07d start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

然后我通过以下线程 8 被带到此页面:信号 SIGABRT 错误:

->  0x112538d42 <+10>: jae    0x112538d4c               ; <+20>

我在谷歌上搜索了很多关于 NSEXCEPTION 的内容,但我似乎仍然无法运行我的应用程序。任何帮助将不胜感激

最佳答案

显然 react-native 0.48.0 有问题。

你可以关注下面的线程,它应该在 0.48.1 中修复。 https://github.com/facebook/react-native/issues/15768

编辑:我可以确认 0.48.1 工作正常。更新使用:

npm install -g react-native-git-upgrade

react-native-git-upgrade

关于ios - 我无法在 ios Xcode 上运行我的 react-native 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46033519/

相关文章:

ios - 将 iPad Playground 转换为 Xcode 10 Playground

ios - Xcode 9 错误 : "iPhone has denied the launch request"

ios - UISegmentedControl - selectedSegment 在 Touch up 时不会改变?

javascript - IOS - React Native - 未处理的 JS 异常 : SyntaxError

react-native - React Native 中的选择/编辑菜单

ios - 我可以处理 UITabbarController 中的双击吗

swift - Xcode Swift在项目中使用.db数据库

ios - 如何告诉 Xcode 如何包含用尖括号指定的库?

ios - 我是否必须快速删除内置观察者?

android - 运行 react-native run-android : Unexpected Token in build. gradle 时出错