Expo iOS build crashes immediately

Hey, I’m trying to publish my app on AppStore but it crashes immediately on startup in TestFlight… The error I’m receiving is " Invariant Violation: Native module cannot be null", nothing more. App works perfectly fine in Expo Go and on Android. I have also tried running the app in Expo Go with the --minify and --no-dev options with no luck of reproducing the error (trying to get more specific error logs…). So my question is how do i fix this? Im using yarn and i have checked every package and installed their dependencies.

Sidenote: i have tried to clear cache and also ran expo upgrade/update to make sure packages are updated and compatible with Expo 42, nothing of this worked and the crashes still happen.

expo diagnostics output:

Expo CLI 4.8.1 environment info:
    System:
      OS: macOS 11.4
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 14.17.1 - /usr/local/bin/node
      Yarn: 1.22.10 - /usr/local/bin/yarn
      npm: 7.19.1 - /usr/local/bin/npm
      Watchman: 2021.06.07.00 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
    IDEs:
      Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~42.0.1 => 42.0.1 
      react: 16.13.1 => 16.13.1 
      react-dom: 16.13.1 => 16.13.1 
      react-native: https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz => 0.63.2 
      react-native-web: ~0.13.12 => 0.13.18 
      react-navigation: ^4.4.4 => 4.4.4 
    npmGlobalPackages:
      expo-cli: 4.8.1
    Expo Workflow: managed

package.json:

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@expo/vector-icons": "^12.0.0",
    "@react-native-async-storage/async-storage": "~1.15.0",
    "@react-native-community/masked-view": "0.1.10",
    "@react-native-picker/picker": "1.16.1",
    "@react-navigation/bottom-tabs": "^5.11.11",
    "@react-navigation/native": "^5.9.4",
    "@react-navigation/stack": "^5.14.5",
    "@reduxjs/toolkit": "^1.6.0",
    "@stripe/stripe-react-native": "^0.1.5",
    "algoliasearch": "^4.10.3",
    "axios": "^0.21.1",
    "expo": "~42.0.1",
    "expo-barcode-scanner": "~10.2.2",
    "expo-camera": "~11.2.1",
    "expo-constants": "~11.0.1",
    "expo-image-picker": "~10.2.2",
    "expo-location": "~12.1.2",
    "expo-secure-store": "~10.2.0",
    "expo-status-bar": "~1.0.4",
    "firebase": "8.2.3",
    "geolib": "^3.3.1",
    "moment": "^2.29.1",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-instantsearch-native": "^6.12.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz",
    "react-native-actions-sheet": "^0.4.9",
    "react-native-gesture-handler": "~1.10.2",
    "react-native-get-random-values": "~1.7.0",
    "react-native-maps": "0.28.0",
    "react-native-paper": "^4.9.2",
    "react-native-reanimated": "~2.2.0",
    "react-native-safe-area-context": "3.2.0",
    "react-native-screens": "~3.4.0",
    "react-native-web": "~0.13.12",
    "react-navigation": "^4.4.4",
    "react-navigation-stack": "^2.10.4",
    "react-redux": "^7.2.4",
    "redux": "^4.1.0",
    "redux-thunk": "^2.3.0",
    "uuid": "^8.3.2"
  },
  "devDependencies": {
    "@babel/core": "~7.13.0"
  },
  "private": true
}

are you using expo build or eas build? stripe is only supported on eas build: Stripe - Expo Documentation

I used expo build previously and tried eas build now, still crashes on startup…

and with what error exactly? you should be able to see these in the xcode crashes organizer. the app crashing doesn’t mean it’s anything on our end, there is likely an issue in your code.

The only error i could find was Invariant Violation: Native module cannot be null and ive been reading out logs live from simulators and going thru crash-logs, nothing else than this error. Also, it might be an issue with my code, but why would it run error and warning-free in Expo go and on Android but not on iOS?

it’s hard to say exactly - it could be a bug in a library that you’re using. usually “Native module cannot be null” comes with some kind of stacktrace indicating where the error originated, which will tell you which module is not being linked when it is expected to be.

you can debug this locally if you have xcode installed by using expo run:ios – you’ll get more info through xcode. just remember to cleanup any generated files after you’re done

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