React Native iOS开发构建启动即崩溃问题求助
iOS开发构建启动崩溃问题求助
我使用React Native开发了一款iOS应用,该应用在iPhone模拟器的Expo App中可正常运行,通过TestFlight分发的构建也能正常工作。现在我想为应用添加Google Ads,但了解到Expo构建无法支持Google Ads,必须创建开发构建来测试广告效果。
我已通过EAS(Expo Application Services)成功编译出开发构建,但将其安装到模拟器后,应用一启动就立即崩溃,我无法确定原因。我尝试解析符号化崩溃报告,但未能找到错误根源,看起来问题与用户界面相关。
以下是崩溃线程信息:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x11324a14a __pthread_kill + 10 1 libsystem_pthread.dylib 0x1132abebd pthread_kill + 262 2 libsystem_c.dylib 0x7ff80016dd1c abort + 133 3 libc++abi.dylib 0x7ff8002c6d12 abort_message + 241 4 libc++abi.dylib 0x7ff8002b951a demangling_terminate_handler() + 266 5 libobjc.A.dylib 0x7ff800061fba _objc_terminate() + 96 6 libc++abi.dylib 0x7ff8002c616b std::__terminate(void (*)()) + 6 7 libc++abi.dylib 0x7ff8002c6126 std::terminate() + 54 8 libdispatch.dylib 0x7ff8001796ec _dispatch_client_callout + 28 9 libdispatch.dylib 0x7ff80017d1e2 _dispatch_block_invoke_direct + 508 10 FrontBoardServices 0x7ff807a8b3a7 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30 11 FrontBoardServices 0x7ff807a8b281 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 188 12 FrontBoardServices 0x7ff807a8b3cf -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 19 13 CoreFoundation 0x7ff800429ff3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 14 CoreFoundation 0x7ff800429f35 __CFRunLoopDoSource0 + 157 15 CoreFoundation 0x7ff800429732 __CFRunLoopDoSources0 + 215 16 CoreFoundation 0x7ff800423e67 __CFRunLoopRun + 919 17 CoreFoundation 0x7ff8004236ed CFRunLoopRunSpecific + 557 18 GraphicsServices 0x7ff8103ba08f GSEventRunModal + 137 19 UIKitCore 0x7ff805cdf6ee -[UIApplication _run] + 972 20 UIKitCore 0x7ff805ce416e UIApplicationMain + 123 21 LeftOff 0x10f870380 main + 96 22 dyld_sim 0x112d3a3e0 start_sim + 10 23 dyld 0x113d57366 start + 1942
我已尝试解决此问题多日,还调整了多个UI相关依赖包的版本,例如react-native-reanimated、react-navigation/stack、react-native-gesture-handler、react-native-screens等,但均未解决问题,恳请帮助。
补充信息
创建开发构建使用的命令:
eas build --profile development-simulator --platform ios --local
我的eas.json文件内容:
{ "cli": { "version": ">= 7.6.0" }, "build": { "development": { "developmentClient": true, "distribution": "internal" }, "preview": { "distribution": "internal" }, "production": { "ios": { "image": "latest" } }, "development-simulator": { "developmentClient": true, "distribution": "internal", "ios": { "simulator": true } } }, "submit": { "production": {} } }
我的package.json文件内容:
{ "name": "mycoolapp", "version": "1.0.0", "scripts": { "start": "expo start --dev-client", "android": "expo run:android", "ios": "expo run:ios", "web": "expo start --web" }, "dependencies": { "@babel/preset-env": "^7.24.5", "@babel/runtime": "^7.24.5", "@expo/config-plugins": "^8.0.4", "@expo/prebuild-config": "^7.0.4", "@react-native-community/masked-view": "^0.1.11", "@react-native-masked-view/masked-view": "^0.2.9", "@react-navigation/bottom-tabs": "^6.5.11", "@react-navigation/native": "^6.1.9", "@react-navigation/native-stack": "^6.9.17", "@react-navigation/stack": "^6.3.20", "apisauce": "^3.0.1", "core-js": "^3.35.1", "expo": "^51.0.8", "expo-build-properties": "~0.12.1", "expo-constants": "~16.0.2", "expo-dev-client": "~4.0.15", "expo-font": "~12.0.6", "expo-modules-core": "^1.12.12", "expo-secure-store": "~13.0.1", "expo-splash-screen": "^0.20.5", "expo-status-bar": "~1.12.1", "firebase": "^10.7.1", "formik": "^2.4.5", "hermes-engine": "^0.11.0", "jwt-decode": "^4.0.0", "postinstall": "^0.10.3", "react": "18.2.0", "react-inspector": "^6.0.2", "react-native": "^0.74.2", "react-native-device-info": "^10.12.0", "react-native-gesture-handler": "^2.16.2", "react-native-google-mobile-ads": "^13.3.0", "react-native-reanimated": "^3.12.0", "react-native-safe-area-context": "^4.10.4", "react-native-screens": "^3.31.1", "react-native-svg": "^15.3.0", "yup": "^1.3.3" }, "devDependencies": { "@babel/core": "^7.24.0", "react-native-dotenv": "^3.4.11" }, "private": true }
内容的提问来源于stack exchange,提问作者Jaylen J
相关产品推荐
相关产品推荐

