React Native 世博会EAS构建APK崩溃在真实的设备上,但世博会的工作去

bvjveswy  于 2023-03-09  发布在  React
关注(0)|答案(1)|浏览(138)

在development env中用模拟器测试时一切运行正常,但是当我用eas build -p android --profile preview命令构建我的expo应用程序来获取apk时,我在真实的设备上安装apk后,它立即崩溃,但如果我在expo go上运行它,它运行正常。
这是我的包. json

{
  "name": "myapp",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@react-native-firebase/app": "^16.4.6",
    "@react-native-firebase/messaging": "^16.4.6",
    "@react-native-picker/picker": "^2.4.8",
    "@react-navigation/drawer": "^6.5.3",
    "@react-navigation/native": "^6.0.16",
    "@react-navigation/stack": "^6.3.7",
    "@reduxjs/toolkit": "^1.9.1",
    "email-validator": "^2.0.4",
    "expo": "~47.0.8",
    "expo-dev-client": "~2.0.1",
    "expo-device": "~5.0.0",
    "expo-image-picker": "~14.0.2",
    "expo-notifications": "~0.17.0",
    "expo-status-bar": "~1.4.2",
    "expo-updates": "~0.15.6",
    "firebase": "^9.6.7",
    "formik": "^2.2.9",
    "react": "18.1.0",
    "react-native": "0.70.5",
    "react-native-gesture-handler": "~2.8.0",
    "react-native-modal-datetime-picker": "^14.0.0",
    "react-native-reanimated": "^2.12.0",
    "react-native-safe-area-context": "^4.4.1",
    "react-native-screens": "~3.18.0",
    "react-native-toast-message": "^2.1.5",
    "react-redux": "^8.0.5",
    "redux": "^4.2.0",
    "redux-thunk": "^2.4.2",
    "yup": "^0.32.11"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9"
  },
  "private": true
}

这是我的eas.json

{
  "cli": {
    "version": ">= 2.6.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "distribution": "internal",
      "android": {
        "buildType": "apk"
      }
    },
    "preview2": {
      "android": {
        "gradleCommand": ":app:assembleRelease"
      }
    },
    "production": {}
  },
  "submit": {
    "production": {}
  }
}
kupeojn6

kupeojn61#

我有一些问题喜欢你,主要原因为什么你有这样的proble是你已经安装了库,比不工作与expo,只有与react-native,检查您的依赖,我猜它会工作

相关问题