【发布时间】:2020-12-25 15:05:48
【问题描述】:
我有一个使用 Expo 构建的 React Native 项目,我们刚刚将它从 SDK 35 更新到 SDK 36,但它现在无法在 Android 和 iOS 上启动。在 iOS 上,它实际上会使 Expo 应用程序本身崩溃,而在 Android 上,它只是坐在白屏上。我认为这是依赖项之一的问题,但我通常不是 React Native 开发人员,所以我不确定它可能是哪一个,但可能是基于以下异常的 NetInfo?
这是来自 iOS 模拟器的一些日志。
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber
isEqualToString:]: unrecognized selector sent to instance 0x86ab4ddf6b4312df'***
First throw call stack:
(
0 CoreFoundation 0x00007fff23c4f02e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff50b97b20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23c6ff94 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00007fff23c53dac ___forwarding___ + 1436
4 CoreFoundation 0x00007fff23c55f38 _CF_forwarding_prep_0 + 120
5 Exponent 0x00000001020ed764 -[ABI37_0_0RNCNetInfo detailsFromInterface:withState:] + 97
6 Exponent 0x00000001020ed51c -[ABI37_0_0RNCNetInfo currentDictionaryFromUpdateState:withInterface:] + 147
7 Exponent 0x00000001020ed44c -[ABI37_0_0RNCNetInfo getCurre<…>
日志 2
2020-09-07 08:38:42.448 [info][tid:com.facebook.ABI37_0_0React.JavaScript] │ '<decode: mismatch for [%c] got [STRING public sz:639]> next state', 'color: #4CAF50; font-weight: bold', { offline:
{ busy: false,
lastTransaction: 0,
online: false,
outbox: [],
retryCount: 0,
retryScheduled: false,
netInfo: { isConnectionExpensive: null, reach: 'NONE' } },
newCatchRecord: {},
signIn: { authToken: undefined, isSignedIn: false, userId: undefined, refreshToken: undefined, numRefreshRetries: 0 },
preferences: { vessels: [], gears: {}, ports: {},species: {} },
submissions: {},
_persist: { version: -1, rehydrated: false } }
以及package.json中列出的依赖项
"dependencies": {
"@expo/vector-icons": "^10.0.0",
"@redux-offline/redux-offline": "^2.6.0-expo.0",
"axios": "^0.18.0",
"bson": "^4.0.2",
"expo": "^36.0.0",
"expo-font": "~8.0.0",
"lodash": "^4.17.11",
"moment": "^2.24.0",
"promise.prototype.finally": "^3.1.0",
"react": "16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz",
"react-native-appearance": "~0.3.1",
"react-native-gesture-handler": "~1.5.0",
"react-native-screens": "2.0.0-alpha.12",
"react-native-simple-radio-button": "^2.7.3",
"react-native-status-bar-height": "^2.3.1",
"react-navigation": "^3.11.0",
"react-redux": "^6.0.1",
"redux": "^4.0.1",
"redux-logger": "^3.0.6",
"redux-persist": "^5.10.0",
"redux-persist-transform-encrypt": "^2.0.1",
"redux-thunk": "^2.3.0",
"styled-components": "^4.1.3",
"@react-native-community/netinfo": "4.6.0"
}
【问题讨论】:
标签: react-native expo