首页 > 解决方案 > ReactNative,应用程序在模拟器上运行,但不在真正的 iPhone 上

问题描述

我正在尝试在 iOS 上运行具有本机反应的应用程序。构建是正确的,但是当我运行它时,它显示启动屏幕,然后保持全白,xcode 向我抛出此错误:

libsystem_kernel.dylib`__pthread_kill:
    0x1dac070fc <+0>:  mov    x16, #0x148
    0x1dac07100 <+4>:  svc    #0x80
->  0x1dac07104 <+8>:  b.lo   0x1dac0711c               ; <+32>
    0x1dac07108 <+12>: stp    x29, x30, [sp, #-0x10]!
    0x1dac0710c <+16>: mov    x29, sp
    0x1dac07110 <+20>: bl     0x1dabfc7d4               ; cerror_nocancel
    0x1dac07114 <+24>: mov    sp, x29
    0x1dac07118 <+28>: ldp    x29, x30, [sp], #0x10
    0x1dac0711c <+32>: ret    

(这里有“->”的行有一个错误:Thread 6: signal SIGABRT,但每次构建都会改变)

和:

2019-08-23 16:39:38.264 [error][tid:com.facebook.react.JavaScript] `View` has no propType for native prop `RCTView.borderTopEndRadius` of native type `CGFloat`
If you haven't changed this prop yourself, this usually means that your versions of the native code and JavaScript code are out of sync. Updating both should make this error go away.
2019-08-23 16:39:38.267586+0200 RFM[321:14377] `View` has no propType for native prop `RCTView.borderTopEndRadius` of native type `CGFloat`
If you haven't changed this prop yourself, this usually means that your versions of the native code and JavaScript code are out of sync. Updating both should make this error go away.
2019-08-23 16:39:38.278 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: `View` has no propType for native prop `RCTView.borderTopEndRadius` of native type `CGFloat`
If you haven't changed this prop yourself, this usually means that your versions of the native code and JavaScript code are out of sync. Updating both should make this error go away.
2019-08-23 16:39:38.278257+0200 RFM[321:14372] Unhandled JS Exception: `View` has no propType for native prop `RCTView.borderTopEndRadius` of native type `CGFloat`
If you haven't changed this prop yourself, this usually means that your versions of the native code and JavaScript code are out of sync. Updating both should make this error go away.
2019-08-23 16:39:38.294345+0200 RFM[321:14372] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: `View` has no propType for native prop `RCTView.borderTopEndRadius` of native type `CGFloat`
If you haven't changed this prop yourself, this usually means that your versions of the native code and JavaScript code are out of sync. Updating both should make this error go away.', reason: 'Unhandled JS Exception: `View` has no propType for native prop `RCTView.borderTopEndRadius` of native type `CGFloat`
If you haven't changed this prop yourself, this usually me..., stack:
verifyPropTypes@26162:22
requireNativeComponent@25498:42
<unknown>@24136:37
loadModuleImplementation@115:12
<unknown>@34748:19
loadModuleImplementation@115:12
<unknown>@34524:24
loadModuleImplementation@115:12
<unknown>@58847:30
loadModuleImplementation@115:12
<unknown>@58500:21
loadModuleImplementation@115:12
<unknown>@58425:23
loadModuleImplementation@115:12
<unknown>@58038:37
loadModuleImplementation@115:12
<unknown>@55269:22
loadModuleImplementation@115:12
<unknown>@1254:19
loadModuleImplementation@115:12
guardedLoadModule@72:45
global code@141506:9
'
*** First throw call stack:
(0x1db070ec4 0x1da241a40 0x1016f28c8 0x1016ee6ec 0x1db078630 0x1daf56450 0x1daf57034 0x101706c34 0x101748b80 0x1017488e0 0x101f9b824 0x101f9cdc8 0x101fa4e6c 0x101fa5b60 0x101fafbfc 0x1dac8d0dc 0x1dac8fcec)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

我有“react”:“16.8.3”和“react-native”:“^0.59.9”。我已经尝试重新启动程序包、清除缓存、重新安装、关闭/打开终端、xcode 等,正如我在一些问题中看到的那样,但没有一个有效。

问题是它在模拟器上正确运行,一些同事在相同的干净 git 分支、版本和设备上尝试过它,并且没有问题。我还尝试过使用我们拥有的另一个应用程序,它可以在模拟器和真实设备上正常运行。

标签: iosiphonexcodereact-native

解决方案


修复了它,我跑了react-native bundle --minify --entry-file index.ios.js --platform ios --dev false --bundle-output ./ios/main.jsbundle --assets-dest ./ios,它工作了......(使用 index.ios.js 或 index.js)


推荐阅读