【问题标题】:When I use metro bundle to run and test the app it works fine. but when I build android apk it not working it restarting again & again当我使用 Metro 捆绑包运行和测试应用程序时,它运行良好。但是当我构建 android apk 它无法正常工作时,它会再次重新启动
【发布时间】:2021-03-24 13:47:43
【问题描述】:

当我使用 Metro 捆绑包运行和测试应用程序时,它运行良好。但是当我构建 android apk 时它无法正常工作,它会再次重新启动

代码

app.json

{
    "expo": {
      "name": "hawala",
      "description": "hawal App",
      "slug": "rikshawala",
      "privacy": "public",
      "platforms": [
        "ios",
        "android"
      ],
      
        "android": {
          "package": "com.rafi.bbb",
          "versionCode": 1
        }
      },
      "notification": {
        "icon": "./assets/images/logo96x96.png"
      },
      "version": "1.0",
      "orientation": "portrait",
      "icon": "./assets/images/logo1024x1024.png",
      "splash": {
        "image": "./assets/images/splash.png",
        "resizeMode": "cover",
        "backgroundColor": "#ffffff"
      },
      "updates": {
        "fallbackToCacheTimeout": 0
      },
      "assetBundlePatterns": [
        "**/*"
      ],
      "packagerOpts": {
        "config": "metro.config.js"
      },
      "ios": {
        "supportsTablet": true,
        "usesAppleSignIn": true,
        "bundleIdentifier": "com.rafi.bbb",
        "infoPlist": {
          "NSLocationAlwaysUsageDescription": "This app uses the always location access in the background for improved pickups and dropoffs, customer support and safety purpose.",
          "NSLocationAlwaysAndWhenInUseUsageDescription": "This app uses the always location access in the background for improved pickups and dropoffs, customer support and safety purpose.",
          "NSLocationWhenInUseUsageDescription": "This app uses the location to find the Cabs near you.",
          "NSCameraUsageDescription": "This app uses the camera to take your profile picture.",
          "NSPhotoLibraryUsageDescription": "This app uses Photo Library for uploading your profile picture.",
          "ITSAppUsesNonExemptEncryption":false,
          "UIBackgroundModes": [
            "audio",
            "location",
            "fetch"
          ]
        },
        "config": {
          "googleMapsApiKey": "aSyA_u1jnW9UF_76hxCrNFut0"
        },
        "googleServicesFile": "./GoogleService-Info.plist",
        "buildNumber": "1.0"
      },
      "android": {
        "package": "com.rafi.bbb",
        "versionCode": 1,
        "permissions": [
          "CAMERA",
          "READ_EXTERNAL_STORAGE",
          "WRITE_EXTERNAL_STORAGE",
          "ACCESS_FINE_LOCATION",
          "ACCESS_COARSE_LOCATION",
          "CAMERA_ROLL",
          "FOREGROUND_SERVICE",
          "ACCESS_BACKGROUND_LOCATION"
        ],
        "googleServicesFile": "./google-services.json",
        "config": {
          "googleMaps": {
            "apiKey": "IzaSyA_u1jnWUFxjyYG_76hxuC6jFut0"
          }
        },
        "useNextNotificationsApi": true
      },
      "facebookScheme": "fb3937477975",
      "facebookAppId": "4337477975",
      "facebookDisplayName": "Rawala"
    }

package.json

{
  "name": "mobile-app",
  "version": "2.5.0",
  "main": "__generated__/AppEntry.js",
  "private": true,
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "clear": "expo r -c",
    "eject": "expo eject",
    "update": "expo update"
  },
  "dependencies": {
    "@firebase/app-types": "^0.6.1",
    "@mapbox/polyline": "^1.1.1",
    "@react-native-async-storage/async-storage": "^1.13.2",
    "@react-native-community/datetimepicker": "3.0.4",
    "@react-native-community/masked-view": "0.1.10",
    "@react-navigation/native": "^5.7.5",
    "assets": "1.0.0",
    "common": "1.0.0",
    "config": "1.0.0",
    "expo": "^40.0.0",
    "expo-apple-authentication": "~2.2.2",
    "expo-asset": "~8.2.1",
    "expo-av": "~8.7.0",
    "expo-constants": "~9.3.3",
    "expo-crypto": "~8.4.0",
    "expo-facebook": "~9.1.0",
    "expo-firebase-recaptcha": "^1.1.0",
    "expo-font": "~8.4.0",
    "expo-image-picker": "~9.2.0",
    "expo-location": "~10.0.0",
    "expo-notifications": "~0.8.2",
    "expo-permissions": "~10.0.0",
    "expo-task-manager": "~8.6.0",
    "expo-updates": "~0.4.1",
    "firebase": "7.9.0",
    "haversine": "1.1.1",
    "react": "16.13.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz",
    "react-native-actions-sheet": "^0.3.5",
    "react-native-dash": "0.0.11",
    "react-native-elements": "^2.3.2",
    "react-native-gesture-handler": "~1.8.0",
    "react-native-google-maps-directions": "^2.1.1",
    "react-native-google-places-autocomplete": "^1.8.0",
    "react-native-maps": "^0.27.1",
    "react-native-modal-datetime-picker": "^8.7.1",
    "react-native-picker-select": "^7.0.0",
    "react-native-reanimated": "~1.13.0",
    "react-native-safe-area-context": "3.1.9",
    "react-native-screens": "~2.15.0",
    "react-native-segmented-control-tab": "^3.4.1",
    "react-native-simple-radio-button": "^2.7.4",
    "react-native-star-rating": "^1.1.0",
    "react-native-vector-icons": "^7.0.0",
    "react-native-webview": "11.0.0",
    "react-navigation": "^4.3.7",
    "react-navigation-drawer": "^2.4.11",
    "react-navigation-stack": "^2.3.11",
    "react-redux": "^7.2.0"
  },
  "devDependencies": {
    "@babel/core": "~7.9.0",
    "babel-preset-expo": "8.3.0",
    "expo-yarn-workspaces": "^1.2.1"
  }
}

【问题讨论】:

    标签: reactjs react-native react-native-android


    【解决方案1】:

    我使用此命令在生产模式下运行 expo 应用程序。 博览会开始 --no-dev --minify。 你会得到确切的错误

    我得到这个错误 未捕获的错误:java.lang.Exception:Faild to load all assetsenter image description here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-10
      • 1970-01-01
      • 2019-11-22
      • 1970-01-01
      • 2020-10-09
      • 1970-01-01
      • 1970-01-01
      • 2022-01-24
      相关资源
      最近更新 更多