При создании собственного проекта React для Release, он успешно собирается, но при запуске на устройстве или в симуляторе экран остается белым, и в XCode появляется следующий журнал:
2018-10-08 10:28:57.199743+0200 ProjectName[24497:338417]
libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not
supported on this platform.
2018-10-08 10:28:57.329034+0200 ProjectName[24497:338417] [Crashlytics]
Version 3.10.8 (131)
2018-10-08 10:28:57.696 [error][tid:com.facebook.react.JavaScript]
TypeError: n.render is not a function. (In 'n.render()', 'n.render' is
undefined)
This error is located at:
in i
2018-10-08 10:28:57.697854+0200 ProjectName[24497:338510] TypeError:
n.render is not a function. (In 'n.render()', 'n.render' is undefined)
This error is located at:
in i
2018-10-08 10:28:57.699 [error][tid:com.facebook.react.JavaScript]
TypeError: n.render is not a function. (In 'n.render()', 'n.render' is undefined)
This error is located at:
in i
2018-10-08 10:28:57.699468+0200 ProjectName[24497:338510] TypeError: n.render is not a function. (In 'n.render()', 'n.render' is undefined)
This error is located at:
in i
2018-10-08 10:28:57.700 [fatal]
[tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception:
TypeError: n.render is not a function. (In 'n.render()', 'n.render' is
undefined)
This error is located at:
in i
2018-10-08 10:28:57.700153+0200 ProjectName[24497:338494] Unhandled JS
Exception: TypeError: n.render is not a function. (In 'n.render()',
'n.render' is undefined)
This error is located at:
in i
2018-10-08 10:28:57.715202+0200 ProjectName[24497:338494] ***
Terminating app due to uncaught exception 'RCTFatalException: Unhandled
JS Exception: TypeError: n.render is not a function. (In 'n.render()',
'n.render' is undefined)
This error is located at:
in i', reason: 'Unhandled JS Exception: TypeError: n.render is not a
function. (In 'n.rende..., stack:
Jn@211:40538
Ur@211:56432
Ar@211:56864
si@211:61708
li@211:61128
ii@211:60256
Mr@211:59236
pi@211:66432
render@211:69043
exports@371:431
run@367:611
runApplication@367:2058
value@44:4050
<unknown>@44:889
value@44:3310
value@44:861
'
*** First throw call stack:
(
0 CoreFoundation 0x000000010dee929b
__exceptionPreprocess + 331
1 libobjc.A.dylib 0x000000010c124735
objc_exception_throw + 48
2 ProjectName 0x000000010b333d62
RCTFormatError + 0
3 ProjectName 0x000000010b330abc -
[RCTExceptionsManager reportFatalException:stack:exceptionId:] + 507
4 CoreFoundation 0x000000010def011c
__invoking___ + 140
5 CoreFoundation 0x000000010deed5b5 -
[NSInvocation invoke] + 325
6 CoreFoundation 0x000000010deeda06 -
[NSInvocation invokeWithTarget:] + 54
7 ProjectName 0x000000010b34738e -
[RCTModuleMethod invokeWithBridge:module:arguments:] + 612
8 ProjectName 0x000000010b38d145 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 255
9 ProjectName 0x000000010b38cec3 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78
10 libdispatch.dylib 0x000000011113d5d1 _dispatch_call_block_and_release + 12
11 libdispatch.dylib 0x000000011113e63e _dispatch_client_callout + 8
12 libdispatch.dylib 0x0000000111145b47 _dispatch_lane_serial_drain + 791
13 libdispatch.dylib 0x00000001111467c0 _dispatch_lane_invoke + 428
14 libdispatch.dylib 0x00000001111508b8 _dispatch_workloop_worker_thread + 733
15 libsystem_pthread.dylib 0x000000011152d61c _pthread_wqthread + 409
16 libsystem_pthread.dylib 0x000000011152d415 start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Это происходит при сборке черезreact-native run-ios --configuration Release
и через XCode (с конфигурацией выпуска).Отладка работает нормально.
- React-native версия: 0.56
- React версия: 16.3.1
- Машинопись: 3.1.1
Проект использует Typescript!