[Bug]: 'OneSignalFramework/OneSignalFramework.h' file not found
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 Could you show you plugins config in app.json ?
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
Same issue here!
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-pluginis the first plugin in myapp.config.js
This fix worked for me as well. Thanks @mikeislearning!
Please move onesignal-expo-plugin at the root and works fine
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?
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
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 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 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_IDWe 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
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
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?
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
I known what happened. The Azure DevOps build task default to **/*.xcodeproj/project.xcworkspace. To fix the issue, we need to use ios/*.xcworkspace.
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!