React Native EXPO [Android] [EAS]启动时构建崩溃

enxuqcxy  于 2023-01-27  发布在  React
关注(0)|答案(1)|浏览(177)

我最近从SDK 43迁移到了Expo SDK 45,也从经典版本升级到了EAS CLI,我有管理工作流。
当我使用命令eas build --profile preview --platform android创建android构建时。它成功创建了构建,但在启动屏幕上崩溃,没有任何stacktrace。
当我使用开发客户端或Expo GO测试构建版本时,没有任何错误或警告。
在这里我分享我的包. json

{
  "name": "native",
  "version": "1.0.0",
  "private": "true",
  "main": "./index.js",
  "scripts": {
    "postinstall": "patch-package; cp -f patches/manual/createKeyboardAwareNavigator.js ./node_modules/@react-navigation/native/src",
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "eject": "expo eject",
    "test": "node ./node_modules/jest/bin/jest.js --watchAll",
    "prettier": "prettier --write 'src/**/*{.js,.jsx}'",
    "lint": "eslint -c ../../.eslintrc 'src' --ext '.js,.jsx'",
    "lint-fix": "eslint -c ../../.eslintrc 'src' --ext '.js,.jsx' --fix",
    "fix-nav": "cp -f patches/manual/createKeyboardAwareNavigator.js ./node_modules/@react-navigation/native/src"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@expo/browser-polyfill": "0.0.1-alpha.3",
    "@expo/metro-config": "^0.5.1",
    "@expo/react-native-action-sheet": "^3.0.3",
    "@react-native-community/datetimepicker": "6.1.2",
    "@react-native-community/segmented-control": "2.1.1",
    "@react-native-picker/picker": "^2.4.8",
    "babel-plugin-inline-dotenv": "^1.3.3",
    "date-and-time": "2.0.1",
    "deprecated-react-native-prop-types": "^3.0.1",
    "expo": "^45.0.0",
    "expo-app-loading": "~2.0.0",
    "expo-battery": "~6.2.0",
    "expo-brightness": "~10.2.0",
    "expo-camera": "~12.2.0",
    "expo-constants": "~13.1.1",
    "expo-dev-client": "~1.0.1",
    "expo-device": "~4.2.0",
    "expo-document-picker": "~10.2.1",
    "expo-file-system": "~14.0.0",
    "expo-image-manipulator": "~10.3.1",
    "expo-image-picker": "~13.1.1",
    "expo-linear-gradient": "~11.3.0",
    "expo-linking": "~3.1.0",
    "expo-local-authentication": "~12.2.0",
    "expo-localization": "~13.0.0",
    "expo-location": "~14.2.2",
    "expo-modules-core": "~0.9.2",
    "expo-notifications": "~0.15.4",
    "expo-permissions": "~13.2.0",
    "expo-radio-button": "^1.0.8",
    "expo-screen-capture": "~4.2.0",
    "expo-screen-orientation": "~4.2.0",
    "expo-splash-screen": "~0.15.1",
    "expo-status-bar": "~1.3.0",
    "expo-task-manager": "~10.2.1",
    "expo-updates": "~0.13.4",
    "expo-web-browser": "~10.2.1",
    "geolib": "^3.0.4",
    "gl-matrix": "^3.3.0",
    "i18n-js": "^3.3.0",
    "invariant": "^2.2.4",
    "lodash": "^4.17.11",
    "memoize-one": "^5.1.1",
    "mobx": "^4.2.0",
    "mobx-persist": "^0.4.1",
    "mobx-react": "^5.0.0",
    "moment": "^2.29.1",
    "moment-timezone": "^0.5.31",
    "native-base": "2.13.8",
    "patch-package": "^6.2.0",
    "postinstall-postinstall": "^2.0.0",
    "prop-types": "^15.7.2",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-native": "0.68.2",
    "react-native-btr": "^1.1.4",
    "react-native-calendars": "^1.1254.0",
    "react-native-chart-kit": "^4.0.0",
    "react-native-datepicker": "^1.7.2",
    "react-native-floating-action": "^1.20.0",
    "react-native-geocoding": "^0.5.0",
    "react-native-gesture-handler": "~2.2.1",
    "react-native-get-random-values": "~1.8.0",
    "react-native-gifted-chat": "0.16.3",
    "react-native-keyboard-aware-scroll-view": "^0.9.3",
    "react-native-loading-spinner-overlay": "^2.0.0",
    "react-native-maps": "0.30.2",
    "react-native-masked-text": "^1.12.3",
    "react-native-modal": "^11.10.0",
    "react-native-multiple-select": "^0.5.9",
    "react-native-options-menu": "^2.0.2",
    "react-native-paper": "4.12.0-alpha.0",
    "react-native-picker-select": "7.0.0",
    "react-native-root-toast": "3.3.0",
    "react-native-screens": "~3.11.1",
    "react-native-slider": "^0.11.0",
    "react-native-svg": "12.3.0",
    "react-native-svg-transformer": "^0.14.3",
    "react-native-swipe-gestures": "^1.0.5",
    "react-native-table-component": "^1.2.1",
    "react-native-tableview-simple": "^2.4.1",
    "react-native-typography": "^1.4.0",
    "react-native-vector-icons": "^8.1.0",
    "react-native-web": "0.17.7",
    "react-native-webview": "11.18.1",
    "react-navigation": "3.11.0",
    "rn-pdf-reader-js": "^4.1.1",
    "rn-tooltip": "^3.0.0",
    "sentry-expo": "^4.2.0",
    "socket.io-client": "^1.7.1",
    "superagent": "^5.0.7",
    "superagent-promise": "^1.1.0",
    "uuidv4": "^6.2.13"
  },
  "devDependencies": {
    "babel-eslint": "^10.0.3",
    "babel-preset-expo": "~9.1.0",
    "eslint": "^5.16.0",
    "eslint-config-airbnb": "^17.1.0",
    "eslint-plugin-import": "^2.14.0",
    "eslint-plugin-jsx-a11y": "^6.1.2",
    "eslint-plugin-react": "^7.11.1",
    "jest-expo": "^45.0.0",
    "prettier": "^2.0.5",
    "@babel/core": "^7.12.9"
  }
}

app.json

{
  "expo": {
    "name": "Norsktimeregister",
    "slug": "native-norsk-2",
    "privacy": "public",
    "entryPoint": "./index.js",
    "platforms": [
      "ios",
      "android"
    ],
    "orientation": "default",
    "version": "1.16.1",
    "icon": "./assets/images/app-icon2.png",
    "splash": {
      "image": "./assets/images/splash-logo.png",
      "resizeMode": "contain",
      "backgroundColor": "#222D93"
    },
    "hooks": {
      "postPublish": [
        {
          "file": "sentry-expo/upload-sourcemaps",
          "config": {
            "organization": "Norsktime",
            "project": "NorsktimeRN",
            "authToken": "************************************************"
          }
        }
      ]
    },
    "updates": {
      "enabled": false
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "bundleIdentifier": "com.tidogkontroll.norsktime",
      "googleServicesFile": "./GoogleService-Info.plist",
      "infoPlist": {
        "NSCameraUsageDescription": "Norsktimeregister uses the camera to immediately add images to time logs.",
        "NSPhotoLibraryUsageDescription": "Norsktimeregister needs access to your photo library to let you add images to time logs.",
        "NSLocationAlwaysUsageDescription": "Norsktimeregister needs to access your location to automatically stamp you in/out.",
        "NSLocationUsageDescription": "Norsktimeregister needs to access your location to automatically stamp you in/out.",
        "NSLocationWhenInUseUsageDescription": "Norsktimeregister needs to access your location to automatically stamp you in/out.",
        "NSLocationAlwaysAndWhenInUseUsageDescription": "Norsktimeregister needs to access your location to automatically stamp you in/out.",
        "UIBackgroundModes": [
          "location",
          "fetch"
        ],
        "LSApplicationQueriesSchemes": [
          "http",
          "https"
        ]
      },
      "supportsTablet": true,
      "config": {
        "googleMapsApiKey": "********************",
        "usesNonExemptEncryption": false
      },
      "usesIcloudStorage": true,
      "requireFullScreen": true,
      "buildNumber": "1"
    },
    "android": {
      "googleServicesFile": "./google-services.json",
      "config": {
        "googleMaps": {
          "apiKey": "**************************"
        }
      },
      "versionCode": 136,
      "package": "com.tidogkontroll.norsktime",
      "permissions": [
        "ACCESS_COARSE_LOCATION",
        "ACCESS_FINE_LOCATION",
        "CAMERA",
        "MANAGE_DOCUMENTS",
        "READ_EXTERNAL_STORAGE",
        "WRITE_EXTERNAL_STORAGE",
        "RECEIVE_BOOT_COMPLETED",
        "WRITE_SETTINGS"
      ],
      "softwareKeyboardLayoutMode": "pan",
      "useNextNotificationsApi": true
    },
    "extra": {
      "eas": {
        "projectId": "*************************"
      }
    }
  }
}

eas.json

{
  "cli": {
    "version": ">= 2.9.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "android": {
        "buildType": "apk"
      },
      "ios": {
        "simulator": true
      }
    },
    "preview": {
      "distribution": "internal",
      "android": {
        "buildType": "apk"
      },
      "ios": {
        "simulator": true
      }
    },
    "production": {}
  },
  "submit": {
    "production": {}
  }
}

我们已经用不同的方法进行了测试,比如创建自定义入口点和默认入口点。
有人能看一下吗,任何帮助都将不胜感激。提前感谢。

lmyy7pcs

lmyy7pcs1#

我遇到了这个问题,这是由于启动屏幕。尝试从您的app.json中删除启动屏幕配置。

相关问题