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

Error IOS #108

Open
thinh2408 opened this issue Aug 28, 2019 · 10 comments
Open

Error IOS #108

thinh2408 opened this issue Aug 28, 2019 · 10 comments

Comments

@thinh2408
Copy link

'React/RCTBridgeModule.h' file not found

@arevaldez
Copy link

This is not an issue with the library, this is a React issue. It could be many things. It could be a PodFile issue, a Pods and React modules running in parallel issue, etc. But, this isn't an issue with the library itself. If you can, I'd try running it on just Android. It'll probably be okay!

@datvp09
Copy link

datvp09 commented Oct 15, 2019

@arevaldez how can I fix it?
My project use react-native 0.61 which doesn't have React podfile

@arevaldez
Copy link

arevaldez commented Oct 15, 2019

@datvp09 you have to install the pod files. Typically by going into the iOS folder and running pod install

@nvdnvd00
Copy link

nvdnvd00 commented Nov 5, 2019

I have the same issue, any idea?

@afrakhan123
Copy link

I have the same issue on react native 0.61, i got it to work with older react native versions

@patroldo
Copy link

patroldo commented Feb 28, 2020

I figured out how to resolve the issue. Btw, here is how to make this repository available to install via pods.

  1. Remove all ios native dependencies of this module.

  2. In the folder {YOUR_PROJECT}/node_modules/react-native-bluetooth-serial add file
    react-native-bluetooth-serial.podspec

  3. Insert into newly created file follow content:

require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
  s.name         = package['name']
  s.version      = package['version']
  s.summary      = package['description']
  s.license      = package['license']

  s.authors      = package['author']
  s.homepage     = package['homepage']
  s.platform     = :ios, "9.0"

  s.source       = { :git => "https://github.com/rusel1989/react-native-bluetooth-serial.git", :tag => "v#{s.version}" }
  s.source_files  = "ios/**/*.{h,m}"

  s.dependency 'React'
end
  1. Fix file {YOUR_PROJECT}/node_modules/react-native-bluetooth-serial/ios/RCTBluetoothSerial/RCTBluetoothSerial.h, above line

#import <React/RCTBridgeModule.h>

add follow import
#import <React/RCTBridge.h>

Finally it should be like this

...
#import <React/RCTBridge.h> // NEWLY ADDED LINE
#import <React/RCTBridgeModule.h>
...
  1. Make clean build folder

  2. In root of your project enter ios folder and make
    pod install

If all okay, the project should finally builds.

@rusel1989 Could you approve above changes to repository please? At least add pod file?

@WhaSukGO
Copy link

I have the same issue on react native 0.61, i got it to work with older react native versions

@afrakhan123 May I ask which version of React-native you're using?

@arlovip
Copy link

arlovip commented Aug 13, 2020

The same issue here with React Native 0.63.2. Any solution?

@keselme90
Copy link

@patroldo I tried your solution, and now I get 'React/RCTBridge.h' file not found error when I try to build.
Do you know why it might happen?

@keselme90
Copy link

@lchenfox did you find a solution?

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

9 participants