React-native-onesignal: `RCTOneSignal.h file not found` build error

Created on 2 Jan 2017  ·  32Comments  ·  Source: OneSignal/react-native-onesignal

I know this is a common issue but I tried everything many times and I keep getting the same error, not sure what to try next.

image

image

image

image

this is the contents of my Podfile

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'HelloWorld' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for HelloWorld
pod 'OneSignal', '1.13.3'


end
 target 'HelloWorldTests' do
    inherit! :search_paths
    # Pods for testing
  end

using react-native 0.35.0, react-native-onesignal ^1.2.3
using xcode v. 8.2
thank you!!!

Most helpful comment

@nilsers,
Please add the following to your target Header Search Paths under Build Settings on your XCode workspace:
$(SRCROOT)/../node_modules/react-native-onesignal/ios/RCTOneSignal
Should build fine, as I tested on your repository.

All 32 comments

I upgraded to beta version of react-native-onesignal and v 2.2.0 of OneSignal pod, same issue still persists

Do you still encounter this issue?
Are you sure you're using the latest version and pod as mentioned in the docs?

Hi!

I'm having the same issue and I have installed the pod as mentioned in the docs.

The build fails with error:

AppDelegate.h:11:9: fatal error: 'RCTOneSignal.h' file not found
#import <RCTOneSignal.h>

I'm using pod version 1.1.1 and Xcode Version 8.2.1 (8C1002) on a macOS 10.12

I have uploaded a demo React Native project which has this issue to my repo onesignal-issuedemo if it helps you.

Thank you for your help!

yes I still have this issue. I'm using one signal pod 2.2.0. pod version 1.1.1. , mac osx 10.11.6

react-native-onesignal version: git://github.com/geektimecoil/react-native-onesignal.git#dev

react-native version 0.35.0

@nilsers i'll try running your project and will let you know.

@nilsers,
Please add the following to your target Header Search Paths under Build Settings on your XCode workspace:
$(SRCROOT)/../node_modules/react-native-onesignal/ios/RCTOneSignal
Should build fine, as I tested on your repository.

@mnmeyers Did you ever get it working? I'm having same probs as you, tried everything here, no dice.

@GeoffreyPlitt I'm getting a bunch of different errors now, pasted below. still debugging. I may try just starting on a new branch, and starting over again. will report back. are you still getting the same error or different ones?

image

Thanks so much for the help! I don't get these errors, no. By the way I'm on XCode 8.2.1, not sure if that makes a difference.

Yes feel free to fork the master branch of https://github.com/GeoffreyPlitt/react_native_minimal to try yourself.

By the way, I have another branch you can fork, which uses v1.2.3 of this lib, and still has those same errors:

https://github.com/GeoffreyPlitt/react_native_minimal/tree/onesignal_123

In file included from /Users/giro/react_native_minimal/ios/react_native_minimal/AppDelegate.m:10:
In file included from /Users/giro/react_native_minimal/ios/react_native_minimal/AppDelegate.h:11:
../node_modules/react-native-onesignal/ios/RCTOneSignal/RCTOneSignal.h:3:9: fatal error: 'OneSignal/OneSignal.h' file not found
#import <OneSignal/OneSignal.h>
        ^

@GeoffreyPlitt so I realized that those errors I was getting were all in the tests folder so I just deleted them (right click > delete) from xcode (the remove references option, not true delete) and then the build succeeded. probably those tests are needed for something but.... that's for another day haha

I am DOA. I am having the same error.

@davidfekke which version of one signal and react-native-one-signal are you using and did you try adding the header search paths as suggested above, did that change anything?

@mnmeyers @davidfekke @GeoffreyPlitt Can you share repositories with the errors reproduceable?

Yes, my repo that reproduces header issues is at https://github.com/GeoffreyPlitt/react_native_minimal/tree/onesignal. Note: Part of my specific problem is that I'm trying to get it working WITHOUT cocoapods; and the error I'm getting is slightly different than the title of this issues, it's about "OneSignal/OneSignal.h" not being found.

Also: Just saw a suggestion on #153 I'm going to try.

Hello guys,

@mnmeyers @davidfekke @GeoffreyPlitt

I had the same issue, and adding
$(SRCROOT)/../node_modules/react-native-onesignal/ios/RCTOneSignal
to Header Search Paths in Build Settings solved my problem.

Make sure you set them for recursive!!! Did not worked until I changed that.

@egunsoma I've done this. Set to recursive. Still saying

/path/to/project/AppDelegate.h:11:9: fatal error: 'RCTOneSignal.h' file not found

I have followed the same steps as you, and I keep having the same error than @passabilities :
path/AppDelegate.h:11:9: 'RCTOneSignal.h' file not found

@Pampounet I recommend updating to the latest 3.0.3 version of this SDK. It greatly simplifies the iOS setup process.
https://github.com/geektimecoil/react-native-onesignal#ios-installation

Most of the above comments do not apply to version 3.0.3 as paths have changed and the iOS native source is now included with this SDK.

@jkasten2 Thanks for your help ! Now I'm getting a new error that makes build failing :
ld: 102 duplicate symbols for architecture x86_64
I'm going to seek help about it now !

@Pampounet Make sure to remove all other copies of the OneSignal iOS native SDK. Such as from cocoapods, manual, or carthage.

@jkasten2 Finally, I had to remove $(inherited) flag in Other Files Flag in my target Build Settings : the build succeeded, but my app is not working anymore... Still working on it !

@Pampounet You might want to start over with a new react project and get the OneSignal SDK up and running. Then copy in your existing javascript code.

@jkasten2 I will try this way, since I don't succeed running anything... but Android version works well, so I keep developing on it for the moment !
Thanks !

@jkasten2 So I tried, and did not manage making it working :'(

im getting this error after i solved architecture one
Cannot find protocol declaration for 'OSSubscriptionObserver'

add "$(SRCROOT)/../node_modules/react-native-onesignal/ios" non-recursive in Framework Search paths
and
add "$(SRCROOT)/../node_modules/react-native-onesignal/ios" recursive in Header search paths

@HananeAlSamrout solution works for me! Thanks

@HananeAlSamrout worked for me too! :)

Thanks

work! Even when is to candidate release
Thanks @HananeAlSamrout

I had to comment out the podfile entry for onesignal to get this to work

@egunsoma I've done this. Set to recursive. Still saying

/path/to/project/AppDelegate.h:11:9: fatal error: 'RCTOneSignal.h' file not found

i also have same issue in NativeBridgeModel.m that AppDelegate.h not found

Was this page helpful?
0 / 5 - 0 ratings