onesignal-expo-plugin icon indicating copy to clipboard operation
onesignal-expo-plugin copied to clipboard

[Bug]: 'OneSignalFramework/OneSignalFramework.h' file not found

Open fw-amgaa opened this issue 1 year ago • 15 comments

What happened?

Created clean expo project, followed this doc: https://documentation.onesignal.com/docs/react-native-expo-sdk-setup. Then I built native ios to test it on my phone, but this error keeps occurring.

Steps to reproduce?

#import <OneSignalFramework/OneSignalFramework.h>
^
'OneSignalFramework/OneSignalFramework.h' file not found

What did you expect to happen?

I expect it to work properly when I build to native IOS from expo.

OneSignal Expo SDK version

2.0.2

Platform

No response

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

fw-amgaa avatar May 27 '24 08:05 fw-amgaa

@fw-amgaa Could you show you plugins config in app.json ?

mrrenaud avatar Jun 14 '24 18:06 mrrenaud

I'm having the same issue, my plugin config looks like:

plugins: [
...
  [
        "onesignal-expo-plugin",
        {
          mode: "development",
        },
      ],

UPDATE: Got it to work by ensuring that onesignal-expo-plugin is the first plugin in my app.config.js

mikeislearning avatar Jun 23 '24 16:06 mikeislearning

Same issue here!

codeagus11 avatar Jul 30 '24 19:07 codeagus11

I'm having the same issue, my plugin config looks like:

plugins: [
...
  [
        "onesignal-expo-plugin",
        {
          mode: "development",
        },
      ],

UPDATE: Got it to work by ensuring that onesignal-expo-plugin is the first plugin in my app.config.js

This fix worked for me as well. Thanks @mikeislearning!

Robooze avatar Aug 01 '24 15:08 Robooze

Please move onesignal-expo-plugin at the root and works fine

codeagus11 avatar Aug 01 '24 19:08 codeagus11

Also struggling with this, @codeagus11 what do you mean with at the root? Just first in the array? Or is there somewhere else we should put this?

louwjlabuschagne avatar Aug 05 '24 11:08 louwjlabuschagne

Also struggling with this, @codeagus11 what do you mean with at the root? Just first in the array? Or is there somewhere else we should put this?

We are not using eas BTW

louwjlabuschagne avatar Aug 05 '24 11:08 louwjlabuschagne

Correct @louwjlabuschagne , you should put the onesignal-expo-plugin as a first element of the array.

EAS is not related to the app.json (or app.config.js). The configuration in this file will change the native properties (inside the android and ios folders).

codeagus11 avatar Aug 05 '24 11:08 codeagus11

@codeagus11 this solves the problem when building the app in the GUI, however, if we try and build using xcode CLI using

xcodebuild -scheme "$SCEHEME" \
-archivePath $TMP/$SCEHEME.xcarchive \
-sdk iphoneos \
-configuration Release \
-destination generic/platform=iOS \
DEVELOPMENT_TEAM=$TEAM_ID

We still get the error - any ideas? It seems like the framework needs XCode GUI to ensure the linking to the files?

louwjlabuschagne avatar Aug 05 '24 13:08 louwjlabuschagne

@codeagus11 this solves the problem when building the app in the GUI, however, if we try and build using xcode CLI using

xcodebuild -scheme "$SCEHEME" \
-archivePath $TMP/$SCEHEME.xcarchive \
-sdk iphoneos \
-configuration Release \
-destination generic/platform=iOS \
DEVELOPMENT_TEAM=$TEAM_ID

We still get the error - any ideas? It seems like the framework needs XCode GUI to ensure the linking to the files?

try with npx expo prebuild --clean before

codeagus11 avatar Aug 05 '24 13:08 codeagus11

I can confirm. I'm still experiencing this issue. Moving the one-signal plugin to the first plugin fixed the problem per @mikeislearning 's solution

ChristopherGabba avatar Oct 19 '24 19:10 ChristopherGabba

I'm still experiencing this issue. Moving one-signal plugin to the first plugin on app.config.js didn't fix the issue. Any solutions?

ryhn7 avatar Mar 13 '25 07:03 ryhn7

Me too. The error occurs when building with xcodebuild. But if I build using GUI, it's fine. Also, expo run:ios is also fine. Not sure what's the problem is.

This fork mentioned the same issue, is it related to this issue? https://github.com/eriksape/react-native-onesignal?tab=readme-ov-file#issue-3---symbols-not-found-for-architecture-x86_64-andor-onesignalonesignalh-file-not-found

ltvan avatar Apr 24 '25 15:04 ltvan

I known what happened. The Azure DevOps build task default to **/*.xcodeproj/project.xcworkspace. To fix the issue, we need to use ios/*.xcworkspace.

ltvan avatar Apr 28 '25 04:04 ltvan

I'm having this issue for simulator builds and not production builds.

Putting the onesignal-expo-plugin plugin as first didn't work for me.

let me know if anyone found a solution!

alexwolf22 avatar Nov 14 '25 04:11 alexwolf22