메뉴 건너뛰기

자료실

DATA

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?