React-native-onesignal: OneSignal/OneSignal.h file not found

Created on 6 Jul 2016  路  7Comments  路  Source: OneSignal/react-native-onesignal

when i build i got this error 'OneSignal/OneSignal.h file not found' in RCTOneSignal.h

can i fix it?

in my fold Headers i can't find OneSignal.h

so i was reinstall and linking onesignal library in xcode

but still i have this error

even i copy onesignal.h file to my Headers folder

but i can't solve this error.

how can i fix it?


i found this issue in closed issued

but i can't add this library in cocoapod.

i successed install cocoapod. but add library failed.

how add it in cocoapod?

Most helpful comment

You need to go to your Podfile file, located within the ios folder on the root of your project.
Add the line pod 'OneSignal' as follows:

# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
# use_frameworks!

target 'YourApp' do
...
pod 'OneSignal'

end

target 'YourAppTests' do

end

Then go to terminal, go to the ios folder on the root of your project, then type pod install to install the pods. After that, make sure to drag OneSignal.framework from your Pods project on Xcode to the Frameworks folder on your Xcode workspace.

All 7 comments

You need to go to your Podfile file, located within the ios folder on the root of your project.
Add the line pod 'OneSignal' as follows:

# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
# use_frameworks!

target 'YourApp' do
...
pod 'OneSignal'

end

target 'YourAppTests' do

end

Then go to terminal, go to the ios folder on the root of your project, then type pod install to install the pods. After that, make sure to drag OneSignal.framework from your Pods project on Xcode to the Frameworks folder on your Xcode workspace.

Since it's not a particular issue with the library i'm closing this now. If you have more questions, please don't hesitate.

i success install.

thx for your advices.

but i got error that "symbol(s) not found for architecture x86_64"

however i solve that error now.

https://github.com/geektimecoil/react-native-onesignal/issues/18

helpful me.

You can follow the issue you referred to solve this. Just drag the framework file to the frameworks folder and make sure it's linked on your project build phases.

i'm on react-native 0.37 and here's how i was able to get this to work (i think the readmes/documentation are slightly behind react native).

  1. on a clean branch with none of the onesignal work...
  2. run npm install react-native-onesignal --save
  3. run react-native link
  4. for iOS follow the podfile instructions (be sure to follow the react native version note carefully)
  5. for iOS follow the code additions in the instructions
  6. for android follow the android instructions (most of the code should be there from the link command, but double check everything)
  7. for android be sure to use import com.geektime.reactnativeonesignal.ReactNativeOneSignalPackage; and NOT import com.geektime.rnonesignal.ReactNativeOneSignalPackage; (some old documentation had the rnonesignal and that's since been updated)
  8. then complete config and setup and all files
  9. hopefully that does the trick for you...please reply if you have any issues as i spent some time on both android and iOS over a few branches to get this to work.

YMMV if you are using something lower than v0.37 of RN. good luck.

Ran into this trying to use Auth0 with RN - posted our fix here.

https://github.com/auth0/react-native-lock/issues/133

$ /usr/local/bin/git clone https://github.com/CocoaPods/Specs.git master
--progress
Cloning into 'master'...
remote: Counting objects: 2114584, done.
remote: Compressing objects: 100% (386/386), done.
error: RPC failed; curl 56 SSLRead() return error -36 | 48.00 KiB/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
[!] /usr/local/bin/git clone https://github.com/CocoaPods/Specs.git master --progress

Cloning into 'master'...
remote: Counting objects: 2114584, done.
remote: Compressing objects: 100% (386/386), done.
error: RPC failed; curl 56 SSLRead() return error -36 | 48.00 KiB/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

Was this page helpful?
0 / 5 - 0 ratings