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]: 'OneSignalFramework/OneSignalFramework.h' file not found #231

Open fw-amgaa opened 4 months ago

fw-amgaa commented 4 months ago

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

mrrenaud commented 3 months ago

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

mikeislearning commented 3 months ago

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

codeagus11 commented 2 months ago

Same issue here!

Robooze commented 1 month ago

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!

codeagus11 commented 1 month ago

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

louwjlabuschagne commented 1 month ago

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 commented 1 month ago

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

codeagus11 commented 1 month ago

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).

louwjlabuschagne commented 1 month ago

@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?

codeagus11 commented 1 month ago

@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