Crash on start react-native after upgrade expo to 46 on old ios versions 12.4 13.1

After upgrade expo from 44 to 46, I got exception on old ios versions (iphone 6) build with release scheme. On ios >=15.4 or with debug (metro load) scheme it’s normal start.

WARNING: Logging before InitGoogleLogging() is written to STDERR E0930 01:57:14.257498 176271360 NativeToJsBridge.cpp:188] Attempting to call JS function on a bad application bundle: AppRegistry.runApplication() 2022-09-30 01:57:14.258909+0500 MyApp[90512:2145532] [native] Unhandled JS Exception: Unexpected token '?'

no stack 2022-09-30 01:57:14.262339+0500 MyApp[90512:2145532] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: Unexpected token '?'

no stack', reason: 'Unhandled JS Exception: Unexpected token '?'

package.json

    "@notifee/react-native": "^5.1.0",
    "@react-native-firebase/analytics": "^14.7.0",
    "@react-native-firebase/app": "~15.4.0",
    "@react-native-firebase/messaging": "^14.7.0",
    "expo-apple-authentication": "~4.3.0",
    "expo-application": "~4.2.2",
    "expo-auth-session": "~3.7.1",
    "expo-background-fetch": "~10.3.0",
    "expo-device": "~4.3.0",
    "expo-font": "~10.2.0",
    "expo-localization": "~13.1.0",
    "expo-media-library": "~14.2.0",
    "expo-random": "~12.3.0",
    "expo-screen-capture": "~4.3.0",
    "expo-secure-store": "~11.3.0",
    "expo-splash-screen": "~0.16.2",
    "expo-status-bar": "~1.4.0",
    "expo-task-manager": "~10.3.0",
    "expo": "^46.0.0",
    "react": "18.0.0",
    "react-dom": "18.0.0",
    "react-native": "0.69.5",

app.config

    "ios": {
      "bundleIdentifier": "myapp",
      "buildNumber": "8",
      "bitcode": "Debug",
      "supportsTablet": true,
      "googleServicesFile": "./GoogleService-Info.plist",
      "usesAppleSignIn": true,
      "infoPlist": {
        "UIBackgroundModes": ["fetch", "remote-notification"]
      }
    },
    "plugins": [
      "@react-native-firebase/app",
      "@notifee/react-native"
    ],

The problem was in metro.config.js with minificator. To solve it add target option.

config.transformer.minifierPath = require.resolve('metro-minify-esbuild');
  config.transformer.minifierConfig = {
     target: 'es6', // <-- For old ios
  };
1 Like

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