繁体   English   中英

应用程序在启动画面后立即在 Testflight 中崩溃,但在 Expo 中没有

[英]App crashes in Testflight immediately after splash screen but not in Expo

使用 EAS 从 Expo SDK 44(expo 构建)升级到 SDK 47 后,我无法让我的应用程序在 Testflight 中运行。 到目前为止,我的应用程序在 Expo 运行。但是当我使用 EAS 构建并尝试运行它时,它会在启动画面后崩溃。

崩溃日志提到 EXUpdatesErrorRecovery.m 但到目前为止在 inte.net 上的搜索只让我了解到它可以是任何东西。

痕迹

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  2

Last Exception Backtrace:
0   CoreFoundation                  0x18da4de88 __exceptionPreprocess + 164 (NSException.m:202)
1   libobjc.A.dylib                 0x186d838d8 objc_exception_throw + 60 (objc-exception.mm:356)
2   MetarTaf                        0x102d8b3bc -[EXUpdatesAppController throwException:] + 24 (EXUpdatesAppController.m:485)
3   MetarTaf                        0x102d9cbd8 -[EXUpdatesErrorRecovery _crash] + 768 (EXUpdatesErrorRecovery.m:268)
4   MetarTaf                        0x102d9c420 -[EXUpdatesErrorRecovery _runNextTask] + 200 (EXUpdatesErrorRecovery.m:184)
5   libdispatch.dylib               0x19501c4b4 _dispatch_call_block_and_release + 32 (init.c:1518)
6   libdispatch.dylib               0x19501dfdc _dispatch_client_callout + 20 (object.m:560)
7   libdispatch.dylib               0x195025694 _dispatch_lane_serial_drain + 672 (inline_internal.h:2632)
8   libdispatch.dylib               0x1950261e0 _dispatch_lane_invoke + 384 (queue.c:3940)
9   libdispatch.dylib               0x195030e10 _dispatch_workloop_worker_thread + 652 (queue.c:6846)
10  libsystem_pthread.dylib         0x1daaa3df8 _pthread_wqthread + 288 (pthread.c:2618)
11  libsystem_pthread.dylib         0x1daaa3b98 start_wqthread + 8 (:-1)

使用的硬件(iPhone 13)

Incident Identifier: A562E67E-ABF6-4196-B5DD-ACED79363679
Hardware Model:      iPhone14,5
Process:             -- [16963]
Path:                --
Identifier:          --
Version:             2.4.0 (2.4.5)
AppStoreTools:       14C17
AppVariant:          1:iPhone14,5:16
Beta:                YES
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           -- [2764]

Date/Time:           2023-01-28 11:53:14.2711 +0100
Launch Time:         2023-01-28 11:53:13.6737 +0100
OS Version:          iPhone OS 16.1.1 (20B101)
Release Type:        User
Baseband Version:    2.12.02
Report Version:      104

包.json

..   "dependencies": {
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-clipboard/clipboard": "^1.11.1",
    "@react-navigation/material-bottom-tabs": "^6.2.11",
    "@react-navigation/material-top-tabs": "^6.5.2",
    "@react-navigation/native-stack": "^6.9.8",
    "deprecated-react-native-prop-types": "^4.0.0",
    "expo": "^47.0.0",
    "expo-application": "~5.0.1",
    "expo-constants": "~14.0.2",
    "expo-device": "~5.0.0",
    "expo-file-system": "~15.1.1",
    "expo-font": "~11.0.1",
    "expo-linking": "~3.3.0",
    "expo-localization": "~14.0.0",
    "expo-location": "~15.0.1",
    "expo-notifications": "~0.17.0",
    "expo-speech": "~11.0.0",
    "expo-status-bar": "~1.4.2",
    "expo-store-review": "~6.0.0",
    "expo-system-ui": "~2.0.1",
    "expo-updates": "~0.15.6",
    "react": "18.1.0",
    "react-dom": "18.1.0",
    "react-native": "0.70.5",
    "react-native-elements": "^3.4.3",
    "react-native-gesture-handler": "~2.8.0",
    "react-native-pager-view": "6.0.1",
    "react-native-paper": "^4.12.5",
    "react-native-popup-menu": "^0.15.13",
    "react-native-root-toast": "^3.3.1",
    "react-native-safe-area-context": "4.4.1",
    "react-native-screens": "~3.18.0",
    "react-native-stack": "^1.0.0-alpha11",
    "react-native-svg": "13.4.0",
    "react-native-swipeable": "^0.6.0",
    "react-native-tab-view": "^3.3.4",
    "react-native-vector-icons": "^9.2.0",
    "react-native-web": "~0.18.7",
    "react-native-webview": "11.23.1",
    "react-navigation": "^4.4.4"   },   "devDependencies": {
    "@babel/core": "^7.19.3",
    "typescript": "^4.6.3"   },  ..

更新:

当崩溃发生时,我在 XCode 控制台发现一些错误,我已经在我的本地环境中解决了。 为此,我必须根据此处列出的说明侵入 node_modules 以获取 react-native-swipeable 和 react-native 本身: Invariant Violation: ViewPropTypes has been removed from React Native。 迁移到从 'deprecated-react-native-prop-types' 导出的 ViewPropTypes

Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'.
Unhandled JS Exception: Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'.
..
Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.

似乎 EAS 正在尝试使用不同的 node_modules 目录构建应用程序。

希望任何人都可以帮助我。

EAS 维护自己的 node_modules 副本。 因此,更改本地 node_modules 中的脚本对生产构建没有影响。

react-native package (0.70.5) 和 react-native-swipeable (0.6.0) 都没有得到妥善维护,并且在发布时无法正常工作。 他们仍然使用已从 React Native 中删除的 ViewPropTypes。 使用已弃用的 react-native-prop-types package 有一个解决方法。

要使用已弃用的 proptypes package,您需要手动更改 node_modules。 但这些更改不会发送到 EAS。

补丁包通过重播您在服务器端所做的更改来解决这个问题。

根据其文档,我安装了补丁包(请参阅https://www.npmjs.com/package/patch-package )。 首先在 app.json 添加了 post-install hook:

 "scripts": {
+  "postinstall": "patch-package"
 }

然后我安装了 npm package:

npm i patch-package

接下来我注册了补丁包:

npx patch-package react-native
npx patch-package react-native-swipeable

并开始使用清除缓存的新 EAS 构建,以确保:

eas build -p ios --clear-cache

您可以检查 Expo > Build Details > Prebuild 以查看补丁是否已远程应用:

- Config syncing
✔ Config synced
Running "npm install" in the root dir of your repository 
> metartaf@2.4.0 postinstall
> patch-package
patch-package 6.5.1
Applying patches...
react-native@0.70.5 ✔
react-native-swipeable@0.6.0 ✔
added 8 packages, and audited 1331 packages in 2s
83 packages are looking for funding
  run `npm fund` for details
9 high severity vulnerabilities

希望这可以帮助任何有同样问题的人。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM