florindumitru / react-native-sip

SIP module for React Native
GNU General Public License v3.0
44 stars 50 forks source link

iOS build fails after update to 2.9.0 #6

Open oojikoo opened 4 years ago

oojikoo commented 4 years ago

I already mentioned adn discussed on #3 . I think it's not fixed yet.

building on simulator was ok with the previous version 2.8.7 but ios build against physical devices

so I updated to 2.9.0 which fixed the issue. but still it fails.

this is the error message I'm getting. image

Environment

OS X: 10.15.2(Catalina)
Xcode: 11.3
react: '16.9.0',
react-native: '0.61.4',
react-native-sip: '2.9.0'
buraktt commented 4 years ago

I can confirm that it's not building with cyclic dependency errors with following environments:

Xcode: 11.3 (10.15.2 Catalina) / 11.2.1 (10.15 Catalina)
react: '16.8.6',
react-native: '0.60.4',
react-native-sip: '2.9.0'

v2.8.7 builds only for release if bitcode is enabled.

oojikoo commented 4 years ago

@buraktt I solved this by deleting the command line tool. after trying all kind of things. this worked on me.

but just in case, do these first. if this doesn't work.

and you get to install xcode command line tool again.

$ xcode-select --install
buraktt commented 4 years ago

@oojikoo I tried your suggestions and ended up with same errors. Even creating a new project with only dependency as react-native-sip yielded same results. I think I'll stick to 2.8.7 for now. Thanks anyway.

jonasclement commented 4 years ago

Chiming in to say that I experience the cyclic dependency issue as well. On 2.9.0 I experience it when building to both physical devices and the Simulator. On 2.8.7 I can get it to build to the Simulator, however physical devices fail with "please specify target machine". If I apply patching manually to specify a target, I also get the cyclic dependency issue on 2.9.0. I'm going to keep digging around to see if I can fix it, but since my experience with both PJSIP, iOS, and React Native is all fairly limited I won't make any promises.

oojikoo commented 4 years ago

a while After one successful build, I happened to clean the ios build and had the same error( "cyclic dependency issue", "please specify target machine" issue) over again.

and.... I figured out this. It worked multiple times on me whenever the errors happened.

// yes to all 
$ npx react-native-clean-project --remove-iOS-build --remove-iOS-pods 
$ defaults delete com.apple.dt.Xcode

please let me know if this works on you guys.

netstratum-labs commented 4 years ago

tried and still not working

buraktt commented 4 years ago

Suddenly my 2.8.7 build also started to give cyclic dependency errors. I had made a folder backup when it was building ok. Tried to build and had success, after doing pod install it started to give cyclic dependency errors again. (I realized pod install changes Podfile.lock too)

Compared the pod files; difference was cocoapods version (current 1.9.0, old was 1.8.4) & react-native-device-info was installed later.

After downgrading cocoapods to 1.8.4 & removing react-native-device-info

pod install --deployment --no-repo-update

and changing the build config as follows:

Project: Enable bitcode: Yes

Target: Enable bitcode: No

Pods Project: Enable bitcode: No add PJ_AUTOCONF=1 to preprocessor macros (build & release)

react-native-sip: Enable bitcode: Yes

the build was successful, I'll try with 2.9.0 when i have time (same path should work) Still not sure if the problem was react-native-device-info or cocoapods though :)

romreed commented 4 years ago

@buraktt Hi. Can you share the work project with installed react-native-sip?

mtzfactory commented 4 years ago

I'm having the same issue... any advance or reliable solution?

David-Melo commented 4 years ago

Howdy. I've been struggling with this for the last few days and I think I've found a solution.

After some detective work and looking into the error stack trace, I noticed some stand out references in the iOS code that appeared to have conflicts leading to this error. After researching, I found some info about Header Leaks.

Cocoapods has a thing where it maps all the pod headers into one location, and this could cause conflicts. My hunch was that our code was leaking some headers that were affecting the compiling of the other frameworks (Foundation, Darwin, etc).

I found a xconfig setting that allows disabling the mapping of the headers of this module. After applying that to RTCPjSip.xcodeproj and the react-native-sip.podspec file, I was able to make this error go away and successfully build on the simulator and a real device.

I will link to my fork of the repo so you can see the changes I made and where exactly they go. Hopefully this is able to help.

https://github.com/FastPBX/react-native-sip/blob/14cbbf082bc484c8ed8651b110adf475acb2f7bf/react-native-sip.podspec#L21

https://github.com/FastPBX/react-native-sip/blob/14cbbf082bc484c8ed8651b110adf475acb2f7bf/ios/RTCPjSip.xcodeproj/project.pbxproj#L243

I'll add a note about my fork in case you might want to use it. That latest 2.9.0 version of this repo was causing troubles and also the addition of building the PJSIP libraries with Docker was breaking our CI builds because we don't have docker on there. It also uses our fork of PJSIP-Builder that is running PJSIP 2.8.

netstratum-labs commented 4 years ago

Hi David,

Appreciate your effort in making this possible at your side. It is still throwing errors for me.

Bitcode is set to No for react-native-sip Node version : 10.19.0 Xcode Version 10.2.1

Showing All Errors Only Undefined symbol: vtable for cxxabiv1::vmi_class_type_info

Undefined symbol: ___cxa_guard_release

Undefined symbol: operator new(unsigned long)

Undefined symbol: ___cxa_begin_catch

Undefined symbol: std::terminate()

Undefined symbol: ___cxa_pure_virtual

Undefined symbol: vtable for cxxabiv1::si_class_type_info

Undefined symbol: ___cxa_guard_abort

Undefined symbol: vtable for cxxabiv1::class_type_info

Undefined symbol: ___gxx_personality_v0

Undefined symbol: ___cxa_guard_acquire

Undefined symbol: operator delete(void*)

Then I tried with your github project by updating my package.json

"react-native-sip": "https://github.com/FastPBX/react-native-sip.git"

Still it is showing the same issue. Am I missing something here?

mofolo commented 4 years ago

Thanks for your contribution @David-Melo Started a new project with this package but getting the same error.

I added USE_HEADERMAP = NO; to project.pbxproj 'USE_HEADERMAP' => 'NO' to the react-native-sip.prospec file.

It builds perfectly on Simulator, but breaks whenever I try to run on a device or just run a build, I get this error (1 of 21 errors): fatal error: cyclic dependency in module 'Foundation': Foundation -> CoreFoundation -> Darwin -> OpenGLES -> Foundation

mofolo commented 4 years ago

@David-Melo Ignore my ignorance. I simply needed to run > pod install And your fix worked perfectly. Thank you!!