【问题标题】:react native terminating with uncaught exception of type NSException以 NSException 类型的未捕获异常反应本机终止
【发布时间】:2016-01-04 21:57:56
【问题描述】:

在我将 ReactNative 升级到 0.17 后运行我的应用程序时出现错误 我在 0.13 上工作得很好

错误码是

    2016-01-04 12:22:37.405 myapp [16916:350051] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSCFString substringFromIndex:]: Index 175 out of bounds; string length 174'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010ea9ce65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000010dca0deb objc_exception_throw + 48
    2   CoreFoundation                      0x000000010ea9cd9d +[NSException raise:format:] + 205
    3   Foundation                          0x000000010d84811d -[NSString substringFromIndex:] + 126
    4   myapp                            0x000000010d5e15f5 RCTBundlePathForURL + 293
    5   myapp                            0x000000010d5e167d RCTIsXCAssetURL + 45
    6   myapp                            0x000000010d6336d0 -[RCTXCAssetImageLoader canLoadImageURL:] + 48
    7   myapp                            0x000000010d62ac77 -[RCTImageLoader imageURLLoaderForURL:] + 615
    8   myapp                            0x000000010d62c070 __87-[RCTImageLoader loadImageWithTag:size:scale:resizeMode:progressBlock:completionBlock:]_block_invoke_2125 + 368
    9   libdispatch.dylib                   0x000000011201fe5d _dispatch_call_block_and_release + 12
    10  libdispatch.dylib                   0x000000011204049b _dispatch_client_callout + 8
    11  libdispatch.dylib                   0x00000001120268ec _dispatch_queue_drain + 2215
    12  libdispatch.dylib                   0x0000000112025e0d _dispatch_queue_invoke + 601
    13  libdispatch.dylib                   0x0000000112028a56 _dispatch_root_queue_drain + 1420
    14  libdispatch.dylib                   0x00000001120284c5 _dispatch_worker_thread3 + 111
    15  libsystem_pthread.dylib             0x000000011237868f _pthread_wqthread + 1129
    16  libsystem_pthread.dylib             0x0000000112376365 start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException

这里是原始代码 https://gist.github.com/AhmedMAtia/141208f80e28a4343e26

【问题讨论】:

    标签: ios xcode react-native


    【解决方案1】:

    我也遇到了从 0.13 升级的问题。我通过创建一个新项目解决了这个问题,然后移动了我的自定义应用程序代码。

    【讨论】:

      猜你喜欢
      • 2016-03-25
      • 1970-01-01
      • 2017-07-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-20
      • 2014-07-26
      相关资源
      最近更新 更多