expo / expo

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.
https://docs.expo.dev
MIT License
34.42k stars 5.51k forks source link

App crash on iOS Expo SDK 45 #18180

Closed claudiofus closed 2 years ago

claudiofus commented 2 years ago

Summary

I've just updated to SDK 45 and I'm this error in a managed workflow with eas build, the app crashes on start, this is the error log:

0x000000010302da24 -[RCTBridge setUp] + 48 (RCTBridge.m:365)
0x000000010302d230 -[RCTBridge initWithDelegate:bundleURL:moduleProvider:launchOptions:] + 236 (RCTBridge.m:231)
0x0000000102f176dc init + 20 (<compiler-generated>:0)
0x0000000102f176dc init + 32 (ExpoUpdatesReactDelegateHandler.swift:0)
0x0000000102f176dc specialized ExpoUpdatesReactDelegateHandler.appController(_:didStartWithSuccess:) + 196
0x0000000102f16d44 appController + 8 (<compiler-generated>:0)
0x0000000102f16d44 @objc ExpoUpdatesReactDelegateHandler.appController(_:didStartWithSuccess:) + 52
0x0000000102ef33fc __73-[EXUpdatesAppController appLoaderTask:didFinishWithLauncher:isUpToDate:]_block_invoke + 52 (EXUpdatesAppController.m:262)

It works fine with expo build:ios --no-wait -t archive but with eas build it doesn't work at all, I've tried with app.json updates: {enabled: false} and removing expo-updates from package.json as suggested from @brentvatne but didn't work.

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

iOS

SDK Version (managed workflow only)

45.0.0

Environment

expo-env-info 1.0.4 environment info:
    System:
      OS: macOS 12.4
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 16.15.1 - /usr/local/bin/node
      npm: 8.12.1 - /usr/local/bin/npm
    IDEs:
      Xcode: /undefined - /usr/bin/xcodebuild
    npmPackages:
      @expo/metro-config: ^0.3.18 => 0.3.18 
      babel-preset-expo: ^9.1.0 => 9.1.0 
      expo: ^45.0.0 => 45.0.6 
      react: 17.0.2 => 17.0.2 
      react-native: 0.68.2 => 0.68.2 
    npmGlobalPackages:
      eas-cli: 0.54.1
      expo-cli: 5.4.12
    Expo Workflow: managed

Reproducible demo

Package.json:

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "build-submit": "eas build -p ios --profile diritto --auto-submit",
    "build-old-submit": "npx cross-env APP_ENV=diritto expo build:ios --no-wait -t archive"
  },
  "dependencies": {
    "@expo/ngrok": "^4.1.0",
    "@expo/metro-config": "^0.3.18",
    "@react-native-async-storage/async-storage": "^1.17.3",
    "@react-native-masked-view/masked-view": "^0.2.6",
    "@react-navigation/drawer": "^5.12.9",
    "@react-navigation/native": "^5.9.8",
    "@react-navigation/stack": "^5.14.9",
    "expo": "^45.0.0",
    "expo-ads-admob": "~13.0.0",
    "expo-constants": "~13.1.1",
    "expo-device": "^4.2.0",
    "expo-linear-gradient": "^11.3.0",
    "expo-linking": "^3.1.0",
    "expo-splash-screen": "^0.15.1",
    "expo-store-review": "^5.2.0",
    "firebase": "^9.6.11",
    "prop-types": "^15.7.2",
    "react": "17.0.2",
    "react-native": "0.68.2",
    "react-native-chart-kit": "^6.11.0",
    "react-native-gesture-handler": "~2.2.1",
    "react-native-reanimated": "~2.8.0",
    "react-native-safe-area-context": "4.2.4",
    "react-native-screens": "~3.11.1",
    "react-native-svg": "^12.3.0",
    "sentry-expo": "^4.2.0"
  },
  "devDependencies": {
    "babel-preset-expo": "^9.1.0",
    "eslint-config-handlebarlabs": "^0.0.6",
    "prettier": "^2.7.1",
    "react-devtools": "^4.24.7",
    "react-native-debugger": "^1.1.0"
  },
  "private": true
}
expo-bot commented 2 years ago

Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it in a new issue.

The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine. Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue.

A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own.

Resources

kbrandwijk commented 2 years ago

sentry-expo has a few peer dependencies, as mentioned in the docs. I don't see those installed in your project. Take another look at the sentry-expo docs, and try to provide a reproducible example if you want us to look into this further.

claudiofus commented 2 years ago

Hello, thanks for your answer, I've run expo install expo-application expo-constants expo-device expo-updates @sentry/react-native, but unfortunately doesn't work. If can help, I used the same code for quiz1, quiz2, quiz3, quiz4, quiz5 but just for quiz3 and quiz4 it worked. This is my app.config.json:

module.exports = () => {
  if (process.env.APP_ENV === "diritto") {
    return require("../quiz1/app.json");
  }
  if (process.env.APP_ENV === "medicina") {
    return require("../quiz2/app.json");
  }
  if (process.env.APP_ENV === "matematica") {
    return require("../quiz3/app.json");
  }
  if (process.env.APP_ENV === "informatica") {
    return require("../quiz4/app.json");
  }
  if (process.env.APP_ENV === "prof-san") {
    return require("../quiz5/app.json");
  }
};

This is my quiz1/app.json:

{
  "expo": {
    "name": "Quiz 1",
    "slug": "Quiz_1",
    "privacy": "hidden",
    "platforms": [
      "ios"
    ],
    "plugins": ["sentry-expo"],
    "version": "1.1.8",
    "icon": "https://xxxxx.xxx/square-icon-premium.png",
    "splash": {
      "image": "https://xxxxx.xxx/splash2.png",
      "resizeMode": "contain"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "bundleIdentifier": "com.xxx.xxx",
      "buildNumber": "1.1.8",
      "infoPlist": {
        "CFBundleDevelopmentRegion": "it",
        "NSUserTrackingUsageDescription": "Questo consenso verrà usato per la gestione e analisi dell'app."
      },
      "supportsTablet": true
    },
    "description": "",
    "hooks": {
      "postPublish": [
        {
          "file": "sentry-expo/upload-sourcemaps",
          "config": {
            "organization": "soulfully",
            "project": "quiz1",
            "authToken": "xxxxxxxx"
          }
        }
      ]
    },
    "extra": {
        "sentryDSN": "https://xxxxxxxx.ingest.sentry.io/5730961"
    }
  }
}

The app.json files are exactly the same for all them, except name, slug, icon, image, bundleIdentifier and sentryDSN. Could it be something linked to expo-updates? The app doesn't start at all and from the logs the error is not clear. How can I check if there's something different in expo-updates between these apps?