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

iOS build fails after update to 2.9.0 #6

Open
oojikoo opened this issue Dec 30, 2019 · 13 comments
Open

iOS build fails after update to 2.9.0 #6

oojikoo opened this issue Dec 30, 2019 · 13 comments

Comments

@oojikoo
Copy link

oojikoo commented Dec 30, 2019

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
Copy link

buraktt commented Jan 15, 2020

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
Copy link
Author

oojikoo commented Jan 19, 2020

@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.

  • deleted xcode and installed again
  • deleted DerivedData
  • changed build setting, workspace setting.
$ rm -rf /Library/Developer/CommandLineTools

and you get to install xcode command line tool again.

$ xcode-select --install

@buraktt
Copy link

buraktt commented Jan 19, 2020

@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
Copy link

jonasclement commented Jan 29, 2020

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
Copy link
Author

oojikoo commented Jan 31, 2020

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
  • open XCode workspace in ios/
  • clean build
  • go to workspace setting menu
  • change build system to new build system - mine is new build / new build / default
  • attach the physical device.
  • build(command + b) - don't run
  • (if build ends successfully) go to console and run react-native run-ios

please let me know if this works on you guys.

@netstratum-labs
Copy link

tried and still not working

@buraktt
Copy link

buraktt commented Feb 27, 2020

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
Copy link

romreed commented Mar 17, 2020

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

@mtzfactory
Copy link

mtzfactory commented Mar 19, 2020

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

@David-Melo
Copy link

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
Copy link

netstratum-labs commented Mar 28, 2020

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
Copy link

mofolo commented Sep 7, 2020

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
Copy link

mofolo commented Sep 7, 2020

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

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