重新启动 React Native expo 应用程序时出错,无法加载自定义字体,因此应用程序卡在加载指示器或启动屏幕中:
[Error: Encountered an exception while calling native method: Attempt to invoke virtual method 'java.util.Map abi49_0_0.expo.modules.core.ExportedModule.getExportedMethodInfos()' on a null object reference]
依赖关系
"dependencies": {
"@react-native-async-storage/async-storage": "1.18.2",
"react": "18.2.0",
"react-native": "0.72.10",
"expo": "^49.0.22",
"expo-updates": "~0.18.19",
"@react-navigation/bottom-tabs": "^6.5.11",
"@react-navigation/core": "^6.4.10",
"@react-navigation/native": "^6.1.9",
"@react-navigation/native-stack": "^6.9.17",
"@react-navigation/stack": "^6.3.20",
"i18n-js": "^4.3.2",
}
通过使用解决了
import * as Updates from "expo-updates";
Updates.reloadAsync();
代替使用
import {DevSettings} from "react-native";
DevSettings.reload();