skip to Main Content

I had recently migrated to Expo SDK 45 from SDK 43 and also Upgraded to EAS CLI from classic builds & I’m having managed workflow.

When i create android build using the command eas build --profile preview --platform android.
Its successfully creates the build but crashes at splash screen without any stacktrace.

There is no any errors or warning when i test builds using dev client or Expo GO.

here i’m sharing my package.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": {}
  }
}

We have already tested with different approaches like creating custom entry points & default entry points.

Can someone please take a look, any help will be appreciated.
Thanks in advance.

2

Answers


  1. I had this issue and it was due to the splash screen. Try removing the splash screen config from your app.json.

    Login or Signup to reply.
  2. Enable debug mode on your android device (search on Google/YouTube if you don’t know how). Once it’s done, connect it to your computer with USB cable.

    Then make sure you have adb (Android Debug Bridge) installed on your computer by typing the command "adb" in the command prompt. If you don’t, install it.

    Then type the commande "adb devices" to see if your android device is visible for adb. If you see your device, then type this command:

    adb logcat "*:E"

    "adb" allows communication with Android devices.
    "logcat" displays system and application logs of an Android device.
    "*:E": displays only logs with error severity level (E for Error).

    Then on your mobile, launch your app and once it crashed, check your logs in the terminal. You should see a line:

    ——— beginning of crash

    Then other information about the crash. For example me, I have:

    ——— beginning of crash
    FATAL EXCEPTION: create_react_context
    java.lang.RuntimeException: Unable to load script. Make sure you’re either running Metro blablabla…

    It should give you more info about what is your problem.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search