Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'OpenTok/OpenTok.h' file not found #155

Closed
wzup opened this issue Aug 15, 2018 · 28 comments
Closed

'OpenTok/OpenTok.h' file not found #155

wzup opened this issue Aug 15, 2018 · 28 comments

Comments

@wzup
Copy link

wzup commented Aug 15, 2018

When I try to build RN I get this error

'OpenTok/OpenTok.h' file not found

Failed to emit precompiled header '/Users/user/Library/Developer/Xcode/DerivedData/app-dqinv...dhb/Build/Intermediates.noindex/PrecompiledHeaders/OpenTokReactNative-Bridging-Header-swift_2BWU7L4RSHBF8-clang_1Q3JG5V7R5679.pch' for bridging header '/Users/user/app/node_modules/opentok-react-native/ios/OpenTokReactNative/OpenTokReactNative-Bridging-Header.h'

Why? How to solve?

@msach22
Copy link
Contributor

msach22 commented Aug 15, 2018

Could you please confirm that you've successfully followed the iOS installation process? I'm not seeing this issue when I add the library.

Please share the version of Xcode and React Native that you're using.

@wzup
Copy link
Author

wzup commented Aug 16, 2018

Yes, I confirm, I followed all the steps.

  1. I've intalled Cocoapods
$ sudo gem install cocoapods
Password:
Fetching: concurrent-ruby-1.0.5.gem (100%)
Successfully installed concurrent-ruby-1.0.5
Fetching: i18n-0.9.5.gem (100%)
Successfully installed i18n-0.9.5
Fetching: thread_safe-0.3.6.gem (100%)
Successfully installed thread_safe-0.3.6
Fetching: tzinfo-1.2.5.gem (100%)
...

$ pod --version
1.5.3
  1. I do pod init
$ cd ios 
$ pod init
  1. I edit Podfile so now it looks like this:
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'myApp' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for myApp
  pod 'OpenTok', '2.14.0'

  # Add new pods below this line

end
  1. Then I do pod install:
$ pod install
Analyzing dependencies
Downloading dependencies
Installing OpenTok (2.14.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
  1. I ignore this step. Because it is obscured.

After installing the iOS SDK, change into your root directory of your project.

This doesn't say anything particular on what to do. What iOS SDK? How to install it? Is it installed by default if I use React-native on Apple computer? It is not clear. I ignore this step.

  1. I'm linking the package.
    I experience problem with linking so I upgrade my React-native.
$ react-native link opentok-react-native
Scanning folders for symlinks in /Users/user/myApp/node_modules (30ms)
rnpm-install info Linking assets to ios project 
rnpm-install info Linking assets to android project 
rnpm-install info Linking opentok-react-native ios dependency 
rnpm-install info Platform 'ios' module opentok-react-native has been successfully linked 
rnpm-install ERR! Something went wrong while linking. Error: Cannot read property 'assetsPath' of null 
Please file an issue here: https://github.com/facebook/react-native/issues 

Cannot read property 'assetsPath' of null

$ react-native upgrade
Scanning folders for symlinks in /Users/serhiirieznikov/sbox/beatit/patientapp/node_modules (37ms)
You should consider using the new upgrade tool based on Git. It makes upgrades easier by resolving most conflicts automatically.
To use it:
- Go back to the old version of React Native
- Run "npm install -g react-native-git-upgrade"
- Run "react-native-git-upgrade"
See https://facebook.github.io/react-native/docs/upgrading.html
Upgrading project to react-native v0.54.2
.... so on...

$ react-native upgrade
Scanning folders for symlinks in /Users/serhiirieznikov/sbox/beatit/patientapp/node_modules (34ms)
rnpm-install info Linking aws-amplify-react-native android dependency 
rnpm-install info Platform 'android' module aws-amplify-react-native has been successfully linked 
rnpm-install info Platform 'ios' module opentok-react-native is already linked 
rnpm-install info Linking opentok-react-native android dependency 
rnpm-install info Platform 'android' module opentok-react-native has been successfully linked 
rnpm-install info Platform 'ios' module react-native-aws-cognito-js is already linked 
rnpm-install info Linking react-native-aws-cognito-js android dependency 
rnpm-install info Platform 'android' module react-native-aws-cognito-js has been successfully linked 
rnpm-install info Platform 'ios' module react-native-contacts is already linked 
rnpm-install info Linking react-native-contacts android dependency 
rnpm-install info Platform 'android' module react-native-contacts has been successfully linked 
rnpm-install info Platform 'ios' module react-native-linear-gradient is already linked 
rnpm-install info Linking react-native-linear-gradient android dependency 
rnpm-install info Platform 'android' module react-native-linear-gradient has been successfully linked 
rnpm-install info Platform 'ios' module react-native-svg is already linked 
rnpm-install info Linking react-native-svg android dependency 
rnpm-install info Platform 'android' module react-native-svg has been successfully linked 
rnpm-install info Platform 'ios' module react-native-vector-icons is already linked 
rnpm-install info Linking react-native-vector-icons android dependency 
rnpm-install info Platform 'android' module react-native-vector-icons has been successfully linked 
rnpm-install info Linking assets to ios project 
rnpm-install info Linking assets to android project 
rnpm-install info Assets have been successfully linked to your project

7-9. I create OTInstall.swift
My ios folder look like this now:

screen shot 2018-08-16 at 9 59 01 am

  1. Window doesn't open.

Click Create Bridging Header when you're prompted with the following modal: Would you like to configure an Objective-C bridging header?

Same error here #93

  1. I edit my Info.plist

Then I try to build and it fails because

'OpenTok/OpenTok.h' file not found

My environment:

Environment:
  OS: macOS High Sierra 10.13.4
  Node: 8.11.3
  Yarn: Not Found
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: Xcode 9.4.1 Build version 9F2000
  Android Studio: 3.1 AI-173.4819257

Packages: (wanted => installed)
  react: 16.3.0-alpha.2 => 16.3.0-alpha.2
  react-native: 0.54.2 => 0.54.2

@wzup
Copy link
Author

wzup commented Aug 17, 2018

@msach22
SO what's your answer? Do you know how to solve it?

@msach22
Copy link
Contributor

msach22 commented Aug 17, 2018

@wzup It looks like you have the use_frameworks! flag enabled when you're installing the OpenTok iOS SDK. This flag should not be enabled so please comment out use_frameworks! like so # use_frameworks!.

Also, you have to run react-native link opentok-react-native from the root directory of your React Native project, not from the iOS folder. I will update the README and change iOS SDK to OpenTok iOS SDK.

Could you please try this and let me know what happens?

@msach22
Copy link
Contributor

msach22 commented Aug 21, 2018

@wzup Hope the installation worked out for you. Could you please update the issue if it's working as expected?

@wzup
Copy link
Author

wzup commented Aug 21, 2018

@msach22
Not yet. I didn't check it yet. Working on other task now then return to this issue and will write my update.
Thanks for follow up.

@msach22
Copy link
Contributor

msach22 commented Sep 3, 2018

@wzup I'm going to go ahead and close this issue due to inactivity. Please re-open with more details if the issue still persists.

@msach22 msach22 closed this as completed Sep 3, 2018
@wzup
Copy link
Author

wzup commented Sep 3, 2018

@msach22
Issue still persist. I had to switch over to another task since it's not that easy to include OpenTok into RN project. But will get back to the issue soon.

@smakosh
Copy link

smakosh commented Dec 14, 2018

@msach22 on your webinar, you clearly enabled the use_frameworks! flag

@msach22
Copy link
Contributor

msach22 commented Dec 14, 2018

@smakosh Yes, at the time of my webinar, the library used to require the use_frameworks! flag, but that's not the case anymore

@smakosh
Copy link

smakosh commented Dec 14, 2018

Well I'm getting the same error above (yep I followed all the steps on the readme file).
I'm on macOS Mojave & using xcode 10

@msach22
Copy link
Contributor

msach22 commented Dec 14, 2018

@smakosh Could you please share the the version of React Native that you're using?

@smakosh
Copy link

smakosh commented Dec 14, 2018

"react-native": "0.55.4"

@msach22
Copy link
Contributor

msach22 commented Dec 15, 2018

Addressed the issue in another conversation: #151 (comment)

@apoorv-1310
Copy link

This issue is still there.
i cannot create it fresh,
i follow the steps but it gives same error

'OpenTok/OpenTok.h' file not found

@msach22 i need ur help.

@smakosh
Copy link

smakosh commented Apr 18, 2019

you will have to take the opentok headers and place them inside your headers folder within the pods folder, cocapods doesn't seem to generate the headers when running pod install

@apoorv-1310
Copy link

@smakosh can u give a links where i can see the steps ?

@apoorv-1310
Copy link

@smakosh and from where do i get opentok headers ?

@smakosh
Copy link

smakosh commented Apr 18, 2019

They don't mention this on their docs, use an old version of cocoapods to generate the headers, store them somewhere online

@apoorv-1310
Copy link

@smakosh can u give me some links ?
i rarely use xcode

@smakosh
Copy link

smakosh commented Apr 18, 2019

@msach22
Copy link
Contributor

msach22 commented Apr 23, 2019

Hey Folks, this is happening when you use Cocoapods 1.6.0. I have not had the opportunity to explore the fix for this yet, but temporarily, you would have to downgrade Cocopods to make it work.
https://stackoverflow.com/questions/20487849/how-to-downgrade-or-install-an-older-version-of-cocoapods

You can specify version 1.5.3 when installing the OpenTok iOS SDK and it should work.
You can also track the issue here: #235

@msach22 msach22 mentioned this issue May 7, 2019
2 tasks
@msach22
Copy link
Contributor

msach22 commented May 7, 2019

Thanks for the feedback - the fix has been deployed with opentok-react-native v0.10.2

@DaltonCastro
Copy link

Hi!
I was facing the same problem when updating cocoapods to the latest one. Downgraded to 1.5.3.

Also, I had to downgrade the opentok-react-native from 0.10.3 to 0.10.1 in order to perform the audio for subscriber on iOS.

Is there an estimative to fix the problem on iOS with the latest opentok-react-native version?
It will be great to keep our projects up-to-date.
Thanx!

@th317erd
Copy link

th317erd commented Oct 11, 2019

I am still having this issue. No solution found here in the issues or on Google. Using Cocapods 1.5.3, opentok-react-native 0.12.1, RN 0.61, and am NOT using use_frameworks! inside Podfile. Help?

@apoorv-1310
Copy link

apoorv-1310 commented Apr 2, 2020

hi
i am using pod 'OpenTok', '2.14.0'

but still i am getting error

OpenTokReactNative-Bridging-Header.h:8:9: error: 'OpenTok/OpenTok.h' file not found
also i have created symlink for opentok/headers to pods/headers/public/

what can be done in this?

@msach22 FYI

@enricop89
Copy link
Contributor

Please use the latest version of iOS SDK, which is pod 'OpenTok', '2.16.5'

@kennethlynne
Copy link

Pro-tip for anyone seeing this after upgrading:
image

before building.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants