应用程序在开发中工作正常,并且在使用“eas build -p android --profile Preview”构建到 apk 时工作正常,应用程序构建成功,没有指定错误,但应用程序在生产中中断,甚至没有通过启动屏幕。
运行 npx expo-env-info 时:
expo-env-info 1.0.5 environment info:
System:
OS: Windows 10 10.0.19045
Binaries:
Node: 20.5.0 - ~\AppData\Roaming\npm\node.CMD
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 9.8.1 - ~\AppData\Roaming\npm\npm.CMD
IDEs:
Android Studio: AI-222.4459.24.2221.9971841
npmPackages:
@expo/webpack-config: ^19.0.0 => 19.0.0
expo: ^49.0.0 => 49.0.11
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.72.4 => 0.72.4
react-native-web: ~0.19.6 => 0.19.8
Expo Workflow: managed
运行 npx expo-doctor 时:
✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check npm/ yarn versions
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check that packages match versions required by installed Expo SDK
✔ Check for legacy global CLI installed locally
✔ Check that native modules do not use incompatible support packages
✔ Check that native modules use compatible support package versions for installed Expo SDK
Didn't find any issues with the project!
错误输出 在 andriod 设备上启动时返回此错误:
我尝试使用 andriod studio 进行调试,并进行构建,它构建成功,但仍然存在同样的问题。
我也尝试过更新和升级所有软件包同样的问题
这是我的 package.json 文件:
{
"name": "yoris",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.341.0",
"@expo-google-fonts/lato": "^0.2.2",
"@expo-google-fonts/oswald": "^0.2.2",
"@expo/vector-icons": "^13.0.0",
"@expo/webpack-config": "^19.0.0",
"@gorhom/bottom-sheet": "^4.4.5",
"@material-tailwind/react": "^1.4.2",
"@miblanchard/react-native-slider": "*",
"@react-md/divider": "^5.1.3",
"@react-native-async-storage/async-storage": "1.18.2",
"@react-native-community/datetimepicker": "7.2.0",
"@react-native-community/geolocation": "^3.0.6",
"@react-native-community/netinfo": "9.3.10",
"@react-native-community/progress-bar-android": "^1.0.5",
"@react-native-community/slider": "4.4.2",
"@react-native-community/viewpager": "5.0.11",
"@react-native-picker/picker": "2.4.10",
"@react-navigation/bottom-tabs": "^6.5.5",
"@react-navigation/drawer": "^6.6.1",
"@react-navigation/material-top-tabs": "^6.5.3",
"@react-navigation/native": "^6.1.4",
"@react-navigation/native-stack": "^6.9.10",
"@react-navigation/stack": "^6.2.1",
"@reduxjs/toolkit": "^1.9.3",
"@rneui/base": "^4.0.0-rc.7",
"@rneui/themed": "^4.0.0-rc.7",
"@sanity/client": "^5.2.1",
"@sanity/image-url": "^1.0.2",
"@volkenomakers/react-native-country-picker": "^1.0.0",
"aws-amplify": "^5.2.2",
"aws-amplify-react-native": "^7.0.2",
"aws-sdk": "^2.1381.0",
"axios": "^1.3.2",
"babel-plugin-inline-import": "^3.0.0",
"camelize": "^1.0.0",
"canvas": "^2.11.0",
"countries-list": "^2.6.1",
"country-list": "^2.3.0",
"crypto-js": "^4.1.1",
"date-fns": "^2.29.3",
"dotenv": "^16.0.3",
"expo": "^49.0.0",
"expo-av": "~13.4.1",
"expo-barcode-scanner": "~12.5.3",
"expo-camera": "~13.4.4",
"expo-checkbox": "~2.4.0",
"expo-constants": "~14.4.2",
"expo-contacts": "~12.2.0",
"expo-dev-client": "~2.4.8",
"expo-document-picker": "~11.5.4",
"expo-image-manipulator": "~11.3.0",
"expo-image-picker": "~14.3.2",
"expo-linear-gradient": "~12.3.0",
"expo-location": "~16.1.0",
"expo-media-library": "~15.4.1",
"expo-permissions": "~14.2.1",
"expo-radio-button": "^1.0.8",
"expo-splash-screen": "~0.20.5",
"expo-status-bar": "~1.6.0",
"firebase": "^9.17.2",
"formik": "^2.2.9",
"install": "^0.13.0",
"jsbarcode": "^3.11.5",
"lodash": "^4.17.21",
"lottie-react-native": "5.1.6",
"moment": "^2.29.2",
"native-base": "^3.4.25",
"nativewind": "^2.0.11",
"pod-install": "^0.1.38",
"qrcode-generator": "^1.4.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-google-autocomplete": "^2.7.3",
"react-google-places-autocomplete": "^4.0.1",
"react-hook-form": "^7.33.1",
"react-md": "^5.1.4",
"react-native": "0.72.4",
"react-native-actions-sheet": "^0.8.21",
"react-native-animatable": "^1.3.3",
"react-native-animated-splash-screen": "^2.0.5",
"react-native-art": "^1.0.0",
"react-native-aws3": "^0.0.9",
"react-native-ble-manager": "^8.4.3",
"react-native-ble-plx": "^2.0.3",
"react-native-calendar": "^0.13.1",
"react-native-calendars": "^1.1293.0",
"react-native-canvas": "^0.1.38",
"react-native-chart-kit": "^6.12.0",
"react-native-country-codes-picker": "^2.2.2",
"react-native-country-picker-modal": "^2.0.0",
"react-native-currency-input": "^1.0.1",
"react-native-date-picker": "^4.2.2",
"react-native-datepicker": "^1.7.2",
"react-native-dotenv": "^3.4.7",
"react-native-dropdown-picker": "^5.4.4",
"react-native-dropdown-select-list": "^2.0.4",
"react-native-eject": "^0.1.2",
"react-native-fit-image": "^1.5.5",
"react-native-gesture-handler": "~2.12.0",
"react-native-google-autocomplete": "^0.2.0",
"react-native-google-places-autocomplete": "^2.5.1",
"react-native-heroicons": "^2.2.0",
"react-native-image-header-scroll-view": "^1.0.0",
"react-native-image-picker": "^5.0.0",
"react-native-maps": "1.7.1",
"react-native-maps-directions": "^1.8.0",
"react-native-modal-datetime-picker": "^13.1.2",
"react-native-modal-dropdown": "^1.0.2",
"react-native-pager-view": "6.2.0",
"react-native-paper": "^5.2.0",
"react-native-permissions": "^3.6.1",
"react-native-phone-code-select": "^1.1.0",
"react-native-phone-number-input": "^2.1.0",
"react-native-progress": "^5.0.0",
"react-native-qrcode-scanner": "^1.5.5",
"react-native-qrcode-svg": "^6.2.0",
"react-native-reanimated": "~3.3.0",
"react-native-responsive-linechart": "^5.7.1",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "~3.22.0",
"react-native-select-dropdown": "^3.2.1",
"react-native-sliding-up-down-panels": "^1.0.0",
"react-native-step-indicator": "^1.0.3",
"react-native-svg": "13.9.0",
"react-native-swipe-up-down": "^1.2.0",
"react-native-swiper": "^1.6.0",
"react-native-switch": "^1.5.1",
"react-native-tab-view": "^3.3.4",
"react-native-uuid": "^2.0.1",
"react-native-vector-icons": "^9.2.0",
"react-native-video": "^5.2.1",
"react-native-view-shot": "3.7.0",
"react-native-web": "~0.19.6",
"react-native-webview": "13.2.2",
"react-redux": "^8.0.5",
"react-s3": "^1.3.1",
"redux": "^4.2.0",
"redux-thunk": "^2.4.1",
"rn-range-slider": "^2.2.2",
"rn-sliding-up-panel": "^2.4.6",
"socket.io-client": "^4.5.4",
"styled-components": "^5.3.6",
"tailwind-react-native-classnames": "^1.5.1",
"twrnc": "^3.6.0",
"typescript": "^5.1.3",
"uid": "^2.0.1",
"watchman": "^1.0.0",
"webpack-dev-server": "^4.11.1",
"yup": "^1.0.0"
},
"devDependencies": {
"@babel/core": "^7.20.0"
},
"private": true
}
更新您的 Expo SDK 和依赖项,禁用不必要的第三方库,在调试模式下运行您的应用程序,并从 Android Studio 构建您的应用程序。
我注意到您在项目中包含了四个不同的包来处理日期选择器:
要解决您的问题,您应该只保留最适合您需求的问题,并从项目中删除其他问题。
另外,我发现您的
package.json
文件包含许多不必要的包。这些额外的包可能会使您的应用程序的文件大小更大,并可能导致错误。因此,在向项目添加库时请务必小心。如果您决定使用其他库并且不再需要旧库,请确保将其删除。这将有助于避免使用相同方法的不同库之间发生冲突。