App crash on launch

Please provide the following:

  1. SDK Version: 39
  2. Platforms(Android/iOS/web/all): Android

Running the app in the expo client doesn’t throw up any errors but whenever I go ahead to build an apk with expo build:android -t apk the app crashes just after showing the splash screen.

When I eject from managed workflow and build apk with gradle the crash doesn’t happen.

package.json:

{

  "scripts": {

    "start": "react-native start",

    "android": "react-native run-android",

    "ios": "react-native run-ios",

    "web": "expo start --web",

    "test": "jest"

  },

  "jest": {

    "setupFilesAfterEnv": ["@testing-library/jest-native/extend-expect"],

    "globals": {

      "__DEV__": true

    },

    "moduleNameMapper": {

      "\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",

      "\\.(css|less)$": "<rootDir>/__mocks__/fileMock.js"

    }

  },

  "dependencies": {

    "@react-native-community/async-storage": "~1.12.0",

    "@react-native-community/masked-view": "0.1.10",

    "@react-native-community/netinfo": "5.9.6",

    "@react-navigation/native": "^5.7.4",

    "@react-navigation/stack": "^5.9.1",

    "@reduxjs/toolkit": "^1.4.0",

    "babel-plugin-transform-remove-console": "^6.9.4",

    "eslint": "^7.9.0",

    "eslint-config-standard": "^14.1.1",

    "eslint-plugin-import": "^2.22.0",

    "eslint-plugin-node": "^11.1.0",

    "eslint-plugin-promise": "^4.2.1",

    "eslint-plugin-react": "^7.21.0",

    "eslint-plugin-standard": "^4.0.1",

    "expo": "~39.0.2",

    "expo-camera": "~9.0.0",

    "expo-file-system": "~9.2.0",

    "expo-font": "~8.3.0",

    "expo-image-picker": "~9.1.0",

    "expo-location": "~9.0.0",

    "expo-media-library": "~9.2.1",

    "expo-permissions": "~9.3.0",

    "expo-splash-screen": "~0.6.1",

    "expo-status-bar": "~1.0.2",

    "expo-updates": "~0.3.2",

    "react": "16.13.1",

    "react-dom": "16.13.1",

    "react-native": "~0.63.2",

    "react-native-gesture-handler": "~1.7.0",

    "react-native-reanimated": "~1.13.0",

    "react-native-safe-area-context": "3.1.4",

    "react-native-screens": "~2.10.1",

    "react-native-unimodules": "~0.11.0",

    "react-native-web": "~0.13.12",

    "react-redux": "^7.2.1",

    "react-test-renderer": "^16.13.1",

    "redux": "^4.0.5",

    "redux-persist": "^6.0.0"

  },

  "devDependencies": {

    "@babel/core": "^7.11.6",

    "@babel/preset-env": "^7.11.5",

    "@babel/preset-react": "^7.10.4",

    "@testing-library/jest-native": "^3.4.2",

    "@testing-library/react-native": "^7.0.2",

    "babel-jest": "^26.3.0",

    "babel-plugin-transform-class-properties": "^6.24.1",

    "jest": "^26.4.2",

    "jest-expo": "^39.0.0",

    "react-test-renderer": "~16.13.1"

  },

  "private": true

}

app.json

{
  "expo": {
    "name": "Weather",
    "slug": "Weather",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/icons/cloud.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "com.weather.app"
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "android": {
      "package": "com.weather.app",
      "versionCode": 1
    },
    "entryPoint": "node_modules/expo/AppEntry.js"
  }
}

refer to: Debugging - Expo Documentation

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.