在 iOS 内部测试期间,我的 React Native Expo 应用程序 (SDK 51) 发生崩溃。当用户执行以下操作时会发生崩溃:
<ButtonFloating fn={ShowAdd} />
const ShowAdd = () => {
navigation.navigate('SolicitudDeFondosAgregar');
};
应用程序崩溃,日志显示以下内容:
Thread 3 name:
Thread 3 Crashed:
0 libsystem_kernel.dylib 0x00000001e070b42c __pthread_kill + 8 (:-1)
1 libsystem_pthread.dylib 0x00000001f44aac0c pthread_kill + 268 (pthread.c:1721)
2 libsystem_c.dylib 0x000000019f5aeba0 abort + 180 (abort.c:118)
3 libc++abi.dylib 0x00000001f43c8ca4 abort_message + 132 (abort_message.cpp:78)
4 libc++abi.dylib 0x00000001f43b8e5c demangling_terminate_handler() + 348 (cxa_default_handlers.cpp:77)
5 libobjc.A.dylib 0x000000018f4f5e2c _objc_terminate() + 144 (objc-exception.mm:496)
6 libc++abi.dylib 0x00000001f43c8068 std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:59)
7 libc++abi.dylib 0x00000001f43c800c std::terminate() + 108 (cxa_handlers.cpp:88)
8 libdispatch.dylib 0x000000019f4f5de8 _dispatch_client_callout + 40 (object.m:579)
9 libdispatch.dylib 0x000000019f4fd400 _dispatch_lane_serial_drain + 748 (queue.c:3900)
10 libdispatch.dylib 0x000000019f4fdf30 _dispatch_lane_invoke + 380 (queue.c:3991)
11 libdispatch.dylib 0x000000019f508cb4 _dispatch_root_queue_drain_deferred_wlh + 288 (queue.c:6998)
12 libdispatch.dylib 0x000000019f508528 _dispatch_workloop_worker_thread + 404 (queue.c:6592)
13 libsystem_pthread.dylib 0x00000001f44a7934 _pthread_wqthread + 288 (pthread.c:2696)
14 libsystem_pthread.dylib 0x00000001f44a40cc start_wqthread + 8 (:-1)
详情:
反应本机版本:0.74.3 世博SDK版本:51.0.21 iOS版本:17.5.1 设备:iPhone 15
我的package.json:
- ...
"dependencies": {
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-community/datetimepicker": "8.0.1",
"@react-native-material/core": "^1.3.7",
"@react-native-picker/picker": "2.7.5",
"@react-navigation/bottom-tabs": "^6.0.9",
"@react-navigation/drawer": "^6.1.8",
"@react-navigation/material-top-tabs": "^6.0.6",
"@react-navigation/native": "^6.1.18",
"@react-navigation/native-stack": "^6.6.2",
"@react-navigation/stack": "^6.4.1",
"axios": "^0.24.0",
"cors": "^2.8.5",
"deprecated-react-native-prop-types": "^5.0.0",
"expo": "~51.0.21",
"expo-constants": "~16.0.2",
"expo-dev-client": "~4.0.20",
"expo-device": "~6.0.2",
"expo-file-system": "~17.0.1",
"expo-media-library": "~16.0.4",
"expo-notifications": "~0.28.10",
"expo-print": "~13.0.1",
"expo-sharing": "~12.0.1",
"expo-splash-screen": "~0.27.5",
"expo-status-bar": "~1.12.1",
"expo-updates": "~0.25.20",
"expo-web-browser": "~13.0.3",
"moment": "^2.29.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.74.3",
"react-native-error-boundary": "^1.2.4",
"react-native-flash-message": "^0.2.1",
"react-native-gesture-handler": "~2.16.1",
"react-native-mask-input": "^1.2.0",
"react-native-modal": "^13.0.1",
"react-native-pager-view": "6.3.0",
"react-native-paper": "^4.11.1",
"react-native-picker-select": "^8.0.4",
"react-native-reanimated": "^3.10.1",
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.31.1",
"react-native-tab-view": "^3.1.1",
"react-native-web": "~0.19.6",
"react-native-woodpicker": "^0.3.17",
"react-navigation": "^4.4.4",
"react-query": "^3.33.7",
"react-redux": "^8.0.2",
"redux": "^4.2.0",
"redux-thunk": "^2.4.1" }, "devDependencies": {
"@babel/core": "^7.12.9",
"@react-native-community/eslint-config": "^3.0.1",
"@types/react": "~18.2.45",
"@types/react-native": "^0.73.0",
"eslint": "^8.5.0",
"eslint-config-universe": "^9.0.0",
"prettier": "^2.5.1",
"typescript": "5.3.3" }, "resolutions": {
"@expo/config-plugins": "^5.0.2",
"@expo/prebuild-config": "~5.0.3",
"expo-modules-autolinking": "~1.0.0" }, "private": true }
我检查了导航设置,一切似乎都配置正确。尽管进行了多次测试和调试尝试,问题仍然存在。该应用程序在 Android 上不会崩溃。
我还使用 npm install react-native-reanimated 安装了 react-native-reanimated 并将其导入到根目录。
我无法安装最新版本的react-native-reanimated:错误:[Reanimated] Reanimated 的 JavaScript 部分和本机部分不匹配(3.14.0 与 3.10.0)。
尝试过这个:GitHub
仍然崩溃。
更新。问题就出在这里:
错误:样式属性“shadowOffset”在 .
中不受支持如果您更新所有依赖项,它将起作用。然而,就我而言,我必须删除它并将其更改为 a ,这在 iOS 和 Android 上都可以正常工作。