自从我开始使用Expo编写React Native时,我一直在与Expo应用一起使用iOS物理设备。 我从来没有遇到过任何重大问题。
现在,我想开始在Android上修复任何错误,但是当在我的Android物理设备上运行Expo应用程序时,Expo应用程序在下载捆绑包时崩溃(关闭)。 它不会将任何错误打印到我的控制台中,所以我甚至不知道从哪里开始...
这是我的app.json:
{
"expo": {
"name": "PointoUserApp",
"slug": "PointoUserApp",
"version": "1.0.0",
"platforms": [
"ios",
"android",
"web"
],
"orientation": "portrait",
"icon": "./assets/Images/icon.png",
"splash": {
"image": "./assets/Images/splash.png",
"resizeMode":"contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"bundleIdentifier": "com.meretc23.PointoUserApp"
},
"android":{
},
"web": {
"favicon": "./assets/Images/favicon.png"
}
}
}
请注意,在Android下它是空的,因为我不知道需要什么。
以下是我的 package.json 文件。
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"@expo-google-fonts/inter": "^0.1.0",
"@fortawesome/fontawesome-svg-core": "^1.2.30",
"@fortawesome/free-brands-svg-icons": "^5.14.0",
"@fortawesome/free-solid-svg-icons": "^5.14.0",
"@fortawesome/react-native-fontawesome": "^0.2.5",
"@ionic/react": "^5.3.1",
"@react-native-community/art": "^1.2.0",
"@react-native-community/async-storage": "~1.11.0",
"@react-native-community/datetimepicker": "2.4.0",
"@react-native-community/masked-view": "0.1.10",
"@react-navigation/bottom-tabs": "^5.7.3",
"@react-navigation/material-top-tabs": "^5.2.16",
"@react-navigation/native": "^5.7.2",
"@react-navigation/stack": "^5.8.0",
"@types/react-native-snap-carousel": "^3.8.2",
"core-js": "^3.6.5",
"expo": "^38.0.0",
"expo-constants": "~9.1.1",
"expo-font": "~8.2.1",
"expo-linking": "^1.0.3",
"expo-localization": "~8.2.1",
"expo-location": "~8.2.1",
"expo-permissions": "~9.0.1",
"expo-status-bar": "^1.0.0",
"firebase": "^7.21.1",
"geolib": "^3.3.1",
"i18n-js": "^3.7.1",
"react": "16.11.0",
"react-dom": "16.11.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz",
"react-native-check-box": "^2.1.7",
"react-native-gesture-handler": "~1.6.0",
"react-native-localize": "^1.4.1",
"react-native-map-clustering": "^3.3.9",
"react-native-map-link": "^2.7.17",
"react-native-maps": "0.27.1",
"react-native-modal": "^11.5.6",
"react-native-picker-select": "^8.0.0",
"react-native-progress": "^4.1.2",
"react-native-progress-circle": "^2.1.0",
"react-native-qrcode-svg": "^6.0.6",
"react-native-reanimated": "~1.9.0",
"react-native-restart": "0.0.17",
"react-native-safe-area-context": "^3.0.7",
"react-native-screens": "~2.9.0",
"react-native-snap-carousel": "^4.0.0-beta.5",
"react-native-svg": "12.1.0",
"react-native-tab-view": "^2.15.1",
"react-native-web": "~0.11.7",
"react-navigation": "^4.4.0",
"react-navigation-stack": "^2.8.2",
"react-redux": "^7.2.1",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"yargs-parser": "^18.1.3"
},
"devDependencies": {
"@babel/core": "^7.8.6",
"babel-preset-expo": "^8.2.3"
},
"private": true
}
教训:如果你想在iOS和Android上运行应用程序,在你的应用程序太大以至于不知道问题来自哪里之前,一定要同时监控两者。
感谢您的帮助。