【问题标题】:ReactNative, app runs on emulator but not on real iPhoneReact Native,应用程序在模拟器上运行,但不在真实 iPhone 上
【发布时间】:2019-12-28 22:50:35
【问题描述】:

我正在尝试在 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 分支、版本和设备上尝试过它,他们没有任何问题。我还尝试过使用我们拥有的另一个应用程序,它可以在模拟器和真实设备上正常运行。

【问题讨论】:

  • 如果您的应用程序在模拟器上运行良好,而您的同事使用完全相同的代码在设备上运行它,这听起来很奇怪。我从日志中看到的唯一有价值的东西是: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. 我会调查一下。

标签: ios iphone xcode react-native


【解决方案1】:

修复它,我运行 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)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-09-01
    • 2021-09-26
    • 2016-09-02
    • 1970-01-01
    • 2018-10-23
    • 1970-01-01
    • 2014-03-27
    相关资源
    最近更新 更多