1

I have an react-native project managed by expo. The project runs smoothly on expo go but after building it by following the current eas build procedure the app crashes on physical device.

To build the apk the eas global cli npm package was installed and after generating a eas.json file it was configured for distributable apk building same as this:

{
  "cli": {
    "version": ">= 3.4.1"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "ios": {
        "resourceClass": "m1-medium"
      }
    },
    "preview": {
      "distribution": "internal",
      "ios": {
        "resourceClass": "m1-medium"
      },
      "android": {
        "buildType": "apk"
      }
    },
    "preview2": {
      "android": {
        "gradleCommand": ":app:assembleRelease"
      }
    },
    "preview3": {
      "developmentClient": true
    },
    "production": {
      "ios": {
        "resourceClass": "m1-medium"
      }
    }
  },
  "submit": {
    "production": {}
  }
}

Finally the command "eas build -p android --profile preview" was executed to build it. But after building it and installing it on the physical device the app crashes after loading the splash image.

This is the package.json file:

{
  "name": "cyberlino",
  "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-navigation/bottom-tabs": "^6.5.2",
    "@react-navigation/material-top-tabs": "^6.5.2",
    "@react-navigation/native": "^6.1.1",
    "@react-navigation/native-stack": "^6.9.7",
    "expo": "~47.0.12",
    "expo-clipboard": "~4.0.1",
    "expo-linear-gradient": "^12.0.1",
    "expo-status-bar": "~1.4.2",
    "react": "18.1.0",
    "react-native": "0.70.5",
    "react-native-modal": "^13.0.1",
    "react-native-toast-message": "^2.1.5",
    "react-native-vector-icons": "^9.2.0"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9"
  },
  "private": true
}

0 Answers0