datso / react-native-pjsip

A PJSIP module for React Native.
http://datso.github.io/react-native-pjsip
GNU General Public License v3.0
273 stars 229 forks source link

iOS fails to build on React Native 0.60+ #189

Closed chris24elias closed 4 years ago

chris24elias commented 4 years ago

Hey there,

Whenever I try to build on iOS i get 'React/RCTUtils.h' file not found error. Any help would be appreciated.

Steps to reproduce on React Native 0.60+:

  1. yarn add react-native-pjsip
  2. react-native link react-native-pjsip
  3. build settings -> disable bitcode
  4. run

Thanks in advance, best regards.

suresh-jbt commented 4 years ago

@chris24elias I'm facing same issue can you please explain How did you resolve this ?

rcidt commented 4 years ago

@suresh-borad The problem is that this lib is not compatible with RN 0.60+ Auto Linking.

1) Fork this library. 2) Create a file called react-native-pjsip.podspec in the root of the project, and copy this into it (dont forget to replace the source url with the url to your fork) :

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 => "YOUR FORK URL" }
  s.source_files  = "ios/RTCPjSip/**/*.{h,m}"

  s.vendored_frameworks='ios/VialerPJSIP.framework'
  s.dependency 'React'
end

3) Then you need to unlink it from your current project, and reference your fork in your package.json. 4) Run npm i or yarn. 5) Then cd ios && pod install

Hope this helps you

aliehsan90 commented 4 years ago

This did not work for me. Is there any other solution?

netstratum-labs commented 4 years ago

Not working for me. I'm getting,

include <pjsua2/persistent.hpp> file not found

rcidt commented 4 years ago

@netstratum-labs you need to completely unlink react-native unlink react-native-pjsip Then confirm all of the linked files are truly gone from your xcode project.

This applies to any other package: if the package is in the Podfile, it should not be manually linked. It will generate conflicts.

mehdinourollah commented 2 years ago

It's still not supporting Autolinking...any plan ?