OneSignal / onesignal-expo-plugin

The OneSignal Expo plugin allows you to use OneSignal without leaving the managed workflow. Developed in collaboration with SweetGreen.
Other
153 stars 49 forks source link

[Bug]: App crashing on launch after integrating OneSignal with managed Expo workflow #176

Closed michael-shattuck closed 1 year ago

michael-shattuck commented 1 year ago

What happened?

After integrating OneSignal using the onesignal-expo-plugin in a managed Expo app, the app crashes on launch when tested on TestFlight for iOS.

Steps to reproduce?

Set up a managed Expo app
Install and configure the onesignal-expo-plugin following the instructions in the README
Build the app and push it to TestFlight for iOS
Launch the app on an iOS device

What did you expect to happen?

I expected the app to launch successfully without any crashes, with OneSignal working as intended.

OneSignal Expo SDK version

onesignal-expo-plugin: 1.3.1 expo: 48.0.6

Platform

iOS

Relevant log output

Date/Time:           2023-04-12 20:39:07.5965 -0600
Launch Time:         2023-04-12 20:39:07.5473 -0600
OS Version:          iPhone OS 16.1.1 (20B101)
Release Type:        User
Baseband Version:    2.12.02
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: DYLD 1 Library missing
Library not loaded: @rpath/OneSignalExtension.framework/OneSignalExtension
Referenced from: <239F39AF-B5D0-39B3-9B66-60B29BFF5DDA> /Volumes/VOLUME/*/Soon.app/Soon
Reason: tried: '/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/private/var/containers/Bundle/Application/EEEB9590-9925-4433-B9C7-C5C452BCE4D8/Soon.app/Frameworks/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/OneSignalExtension.framework/OneSignalExtension' (errno=2), '/usr/lib/swift/On
(terminated at launch; ignore backtrace)

Code of Conduct

RL-Jurica-Penjgusic commented 1 year ago

In order to use one signal with expo, custom expo dev client must be created. Please check out docs: https://docs.expo.dev/develop/development-builds/introduction/

Cheers

brunojacobss commented 1 year ago

Thank you but this issue happens in production (app store) builds as well.

emawby commented 1 year ago

@michael-shattuck @brunojacobss Does this happen when building and testing locally or just for release builds?

RL-Jurica-Penjgusic commented 1 year ago

Is it possible to paste package.json file?

brunojacobss commented 1 year ago

@michael-shattuck @brunojacobss Does this happen when building and testing locally or just for release builds?

Only for release builds, no crashes on custom dev client builds or xcode builds

brunojacobss commented 1 year ago

Is it possible to paste package.json file?

{
  "name": "soon-mobile",
  "version": "1.1.271",
  "private": true,
  "scripts": {
    "postinstall": "patch-package",
    "start": "expo start --dev-client",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "web": "expo start --web",
    "lint": "eslint . --ext .ts,.tsx",
    "eject": "expo eject",
    "release": "standard-version",
    "build:release": "eas build -p all --non-interactive",
    "submit:android": "eas submit -p android --latest",
    "submit:ios": "eas submit -p ios --latest",
    "eas-build-pre-install": "npm config set legacy-peer-deps true"
  },
  "dependencies": {
    "@emotion/native": "^11.0.0",
    "@emotion/react": "^11.4.1",
    "@expo-google-fonts/inconsolata": "^0.2.2",
    "@expo-google-fonts/montserrat": "^0.2.2",
    "@expo/config-plugins": "~6.0.0",
    "@fortawesome/fontawesome-svg-core": "^1.2.36",
    "@fortawesome/free-brands-svg-icons": "^6.2.0",
    "@fortawesome/free-regular-svg-icons": "^5.15.4",
    "@fortawesome/free-solid-svg-icons": "^5.15.4",
    "@fortawesome/pro-duotone-svg-icons": "^6.2.1",
    "@fortawesome/pro-light-svg-icons": "^6.2.0",
    "@fortawesome/pro-solid-svg-icons": "^6.2.0",
    "@fortawesome/react-native-fontawesome": "^0.3.0",
    "@gratifi/design": "^1.21.1",
    "@gratifi/domain": "^1.27.0",
    "@mxenabled/react-native-widget-sdk": "^1.1.1",
    "@ptomasroos/react-native-multi-slider": "^2.2.2",
    "@react-native-async-storage/async-storage": "1.17.11",
    "@react-native-community/datetimepicker": "6.7.3",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/slider": "4.4.2",
    "@react-native-firebase/analytics": "^17.3.2",
    "@react-native-firebase/app": "^17.3.2",
    "@react-native-firebase/dynamic-links": "^17.3.2",
    "@react-native-picker/picker": "2.4.8",
    "@react-navigation/bottom-tabs": "^5.11.10",
    "@react-navigation/core": "^5.15.3",
    "@react-navigation/native": "^5.9.8",
    "@react-navigation/stack": "^5.14.4",
    "@segment/analytics-react-native": "^2.4.0",
    "@segment/sovran-react-native": "^0.4.3",
    "axios": "^0.21.4",
    "base-64": "^1.0.0",
    "dayjs": "^1.10.6",
    "deprecated-react-native-prop-types": "^2.3.0",
    "expo": "^48.0.6",
    "expo-apple-authentication": "~6.0.1",
    "expo-application": "~5.1.1",
    "expo-auth-session": "~4.0.3",
    "expo-build-properties": "~0.5.2",
    "expo-constants": "~14.2.1",
    "expo-crypto": "~12.2.1",
    "expo-dev-client": "~2.1.6",
    "expo-device": "~5.2.1",
    "expo-file-system": "~15.2.2",
    "expo-font": "~11.1.1",
    "expo-image-picker": "~14.1.1",
    "expo-linear-gradient": "~12.1.2",
    "expo-local-authentication": "~13.3.0",
    "expo-mail-composer": "~12.1.1",
    "expo-modules-core": "~1.2.6",
    "expo-random": "~13.1.1",
    "expo-secure-store": "~12.1.1",
    "expo-splash-screen": "~0.18.1",
    "expo-status-bar": "~1.4.4",
    "expo-system-ui": "~2.2.1",
    "expo-updates": "~0.16.4",
    "firebase": "^9.17.2",
    "lodash": "^4.17.21",
    "metro-core": "^0.72.0",
    "onesignal-expo-plugin": "^1.3.1",
    "patch-package": "^6.4.7",
    "postinstall-postinstall": "^2.1.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-error-boundary": "^3.1.4",
    "react-native": "0.71.3",
    "react-native-date-picker": "^4.1.3",
    "react-native-gesture-handler": "~2.9.0",
    "react-native-get-random-values": "^1.8.0",
    "react-native-gleapsdk": "^7.0.8",
    "react-native-global-props": "^1.1.5",
    "react-native-keyboard-aware-scroll-view": "^0.9.4",
    "react-native-onesignal": "^4.5.1",
    "react-native-plaid-link-sdk": "^10.1.0",
    "react-native-purchases": "^5.0.2",
    "react-native-qrcode-svg": "^6.1.2",
    "react-native-responsive-fontsize": "^0.5.1",
    "react-native-safe-area": "^0.5.1",
    "react-native-safe-area-context": "4.5.0",
    "react-native-screens": "~3.20.0",
    "react-native-skeleton-placeholder": "^4.0.0",
    "react-native-svg": "13.4.0",
    "react-native-svg-charts": "^5.4.0",
    "react-native-svg-transformer": "^0.14.3",
    "react-native-user-inactivity": "^1.2.0",
    "react-native-web": "~0.18.11",
    "react-native-webview": "11.26.0",
    "react-query": "^3.34.12",
    "react-redux": "^7.2.2",
    "redux": "^4.0.5",
    "redux-devtools-extension": "^2.13.9",
    "redux-thunk": "^2.3.0",
    "rn-pdf-reader-js": "^4.1.1",
    "rn-tooltip": "^3.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@react-native-community/cli": "^9.3.2",
    "@react-native-community/eslint-config": "^3.0.0",
    "@types/base-64": "^1.0.0",
    "@types/http-errors": "^1.8.2",
    "@types/lodash": "^4.14.168",
    "@types/react": "~18.0.27",
    "@types/react-native-svg-charts": "^5.0.12",
    "@types/react-redux": "^7.1.16",
    "@types/react-router-native": "^5.1.0",
    "@typescript-eslint/eslint-plugin": "^5.45.1",
    "@typescript-eslint/parser": "^5.45.1",
    "babel-plugin-transform-inline-environment-variables": "^0.4.3",
    "eslint": "^8.29.0",
    "http-errors": "^2.0.0",
    "react-native-pager-view": "6.1.2",
    "typescript": "^4.9.4"
  }
}
RL-Jurica-Penjgusic commented 1 year ago

Seems to be valid everything, I assume you have configured plugins something like this?

["onesignal-expo-plugin", {mode: "production"}], ["@react-native-firebase/app"], ["@react-native-firebase/auth"], ["expo-build-properties", {"ios": {"useFrameworks": "static"}}]

brunojacobss commented 1 year ago

Seems to be valid everything, I assume you have configured plugins something like this?

["onesignal-expo-plugin", {mode: "production"}], ["@react-native-firebase/app"], ["@react-native-firebase/auth"], ["expo-build-properties", {"ios": {"useFrameworks": "static"}}]

This is what our plugins look like.

plugins: [
      [
        'onesignal-expo-plugin',
        {
          mode: (process.env.APP_ENVIRONMENT || 'DEVELOPMENT').toLowerCase(),
        },
      ],
      './withRctBridge',
      './withLokHttp3',
      './withFlagImmutableFix',
      './withNoBitcode',
      '@react-native-firebase/app',
      [
        'expo-build-properties',
        {
          android: {
            kotlinVersion: '1.7.21',
          },
          ios: {
            useFrameworks: 'static',
          },
        },
      ],
      [
        'expo-image-picker',
        {
          photosPermission:
            'Allow Soon to access you photos for uploading documents for identity verification.',
          cameraPermission:
            'Allow Soon to access you camera for uploading documents for identity verification.',
        },
      ],
      'expo-apple-authentication',
    ],
brismithers commented 1 year ago

This looks similar to this issue. Can you try my suggestions for that?

You can set the cocoapods version in eas.json. You can set the ruby version in eas.json.

Let me know if this resolves your issue!

rgomezp commented 1 year ago

Closing due to inactivity.

Bilits commented 5 months ago

Having the same issue for android - application perfectly works in development mode but in production after downloading it from google play, it crashes right after lunch. IOS works fine in production, only android

"onesignal-expo-plugin": "^2.0.2", "react-native-onesignal": "^5.1.0", "expo": "~50.0.14", "react": "18.2.0",

karlqueckfeldt commented 5 months ago

Same issue here. As soon as I call either the OneSignal.login or OneSignal.logout functions, my app crashes. It only crashes on Android when downloaded from Google Play though. iOS seems fine. Works great using a development build run on the same device.

"expo": "^50.0.15",
"onesignal-expo-plugin": "^2.0.2",
"react-native-onesignal": "^5.0.5",
amisdun commented 2 months ago

Any fix on this issue?