cordova-plugin-iosrtc icon indicating copy to clipboard operation
cordova-plugin-iosrtc copied to clipboard

Unable to use iosrtc plugin on Mac M1 arm64

Open rsjunior opened this issue 4 years ago • 12 comments

YOU MUST read first!

Please use Community Forum for general technical discussions and questions.

  • [x] I have used Google with the error message or bug in association with the library and Cordova words to make sure the issue I'm reporting is only related to iOSRTC.
  • [x] I have provided steps to reproduce (e.g. using sample app code https://github.com/cordova-rtc/cordova-plugin-iosrtc-sample or updated extra/renderer-and-libwebrtc-tests.js file).
  • [x] I have provided versions of third party library name, ios, Xcode and plugin version and adapter.js version if used.

Note: If the checkboxes above are not checked (which you do after the issue is posted), the issue will be closed, removing this checkbox will result in automatic closed issue.

Versions affected

  • Cordova version (e.g 7.1.0): 10.0.0
  • Cordova iOS version (e.g 5.1.0): 6.2.0
  • Plugin version (e.g 6.0.12): 6.0.21
  • iOS version (e.g 10.2): 14.5
  • Xcode version (e.g 11.1 - 11A1027): 12.5.1
  • WebRTC-adapter version (e.g. 7.4.0): latest
  • WebRTC Framework version (e.g. JSSip 3.1.2):

Description

Build fail on Mac M1

Steps to reproduce

Create blank Ionic project ionic cordova plugin add cordova-plugin-iosrtc ionic cordova platform add ios ionic cordova build ios (for emulators) ionic cordova build ios --prod --release (for production) Both build commands generate same error Same steps works without adding iosrtc plugin

Expected results

Build successfull

Actual results

ld: warning: Could not find or use auto-linked framework 'WebRTC' Undefined symbols for architecture arm64: "_OBJC_CLASS_$_RTCCameraVideoCapturer", referenced from: objc-class-ref in PluginRTCVideoCaptureController.o "_OBJC_CLASS_$_RTCEAGLVideoView", referenced from: objc-class-ref in PluginMediaStreamRenderer.o "_OBJC_CLASS_$_RTCMediaStreamTrack", referenced from: objc-class-ref in PluginMediaStream.o "_OBJC_CLASS_$_RTCDataChannelConfiguration", referenced from: objc-class-ref in PluginRTCDataChannel.o "_OBJC_CLASS_$_RTCDataBuffer", referenced from: objc-class-ref in PluginRTCDataChannel.o "_OBJC_CLASS_$_RTCMediaConstraints", referenced from: objc-class-ref in PluginRTCPeerConnectionConstraints.o "_OBJC_CLASS_$_RTCMediaStream", referenced from: objc-class-ref in PluginRTCPeerConnection.o "_OBJC_CLASS_$_RTCIceServer", referenced from: objc-class-ref in PluginRTCPeerConnectionConfig.o "_OBJC_CLASS_$_RTCConfiguration", referenced from: objc-class-ref in PluginRTCPeerConnectionConfig.o "_OBJC_CLASS_$_RTCIceCandidate", referenced from: objc-class-ref in PluginRTCPeerConnection.o "_OBJC_CLASS_$_RTCSessionDescription", referenced from: objc-class-ref in PluginRTCPeerConnection.o "_kRTCVp8CodecName", referenced from: CondHouse_Gestão_de_Condomínios.iosrtcPlugin.(initPeerConnectionFactory in _AC323BD484FEC511553C8A2ECB08B1FB)() -> () in iosrtcPlugin.o "_OBJC_CLASS_$_RTCVideoCodecInfo", referenced from: objc-class-ref in iosrtcPlugin.o "_OBJC_CLASS_$_RTCDefaultVideoDecoderFactory", referenced from: objc-class-ref in iosrtcPlugin.o "_OBJC_CLASS_$_RTCDefaultVideoEncoderFactory", referenced from: objc-class-ref in iosrtcPlugin.o "_OBJC_CLASS_$_RTCPeerConnectionFactory", referenced from: objc-class-ref in iosrtcPlugin.o "_OBJC_CLASS_$_RTCVideoTrack", referenced from: objc-class-ref in iosrtcPlugin.o objc-class-ref in PluginMediaStream.o objc-class-ref in PluginMediaStreamRenderer.o "_OBJC_CLASS_$_RTCLegacyStatsReport", referenced from: objc-class-ref in PluginRTCPeerConnection.o "_OBJC_CLASS_$_RTCAudioTrack", referenced from: objc-class-ref in iosrtcPlugin.o objc-class-ref in PluginMediaStream.o objc-class-ref in PluginMediaStreamRenderer.o "_kRTCH264CodecName", referenced from: CondHouse_Gestão_de_Condomínios.iosrtcPlugin.(initPeerConnectionFactory in _AC323BD484FEC511553C8A2ECB08B1FB)() -> () in iosrtcPlugin.o "_kRTCVp9CodecName", referenced from: CondHouse_Gestão_de_Condomínios.iosrtcPlugin.(initPeerConnectionFactory in _AC323BD484FEC511553C8A2ECB08B1FB)() -> () in iosrtcPlugin.o "_OBJC_CLASS_$_RTCRtpSender", referenced from: objc-class-ref in PluginRTCPeerConnection.o objc-class-ref in PluginRTCDTMFSender.o "_RTCInitializeSSL", referenced from: CondHouse_Gestão_de_Condomínios.iosrtcPlugin.pluginInitialize() -> () in iosrtcPlugin.o ld: symbol(s) not found for architecture arm64

rsjunior avatar Jul 13 '21 14:07 rsjunior

you may need to strip other architectures. See script https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/extra/ios_arch.js documentation: https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/docs/Building.md#strip-simulator-archs-usage

hthetiot avatar Jul 14 '21 14:07 hthetiot

I got this error on extract command

image

rsjunior avatar Jul 14 '21 19:07 rsjunior

arm64 is here : https://github.com/cordova-rtc/cordova-plugin-iosrtc/tree/master/lib/WebRTC.xcframework/ios-arm64_armv7/WebRTC.framework

if you script crash like that because this is for version prior iosrtc moved to "WebRTC.xcframework" (.xcframework) that is multi-architecture now since couple of versions, your issue most-likely lies into your Xcode settings.

hthetiot avatar Jul 22 '21 11:07 hthetiot

Did you try to use rosetta emulation?

hthetiot avatar Jul 22 '21 14:07 hthetiot

@hthetiot

Did you try to use rosetta emulation?

yes still no luck via rosetta xcode (i am having the same issue with same stack cordova etc yara yara with M1 chip )

khalid-valed avatar Aug 06 '21 15:08 khalid-valed

Got the command from console log & here is the result Screen Shot 2021-08-06 at 21 32 50

khalid-valed avatar Aug 06 '21 15:08 khalid-valed

@khalid-valed i said earlier that we use .xcframework lipo or extract script is only used on old versions.

https://medium.com/trueengineering/xcode-and-xcframeworks-new-format-of-packing-frameworks-ca15db2381d3

hthetiot avatar Aug 08 '21 11:08 hthetiot

Did you try to use rosetta emulation?

@hthetiot sorry my bad. Running via rosette actually did the trick. Previously i guess i had issue with caching or something. I started clean project and got successfully built with rosette emulator. Thanks for the great project. I definitely owe you coffee )

khalid-valed avatar Aug 09 '21 05:08 khalid-valed

For Mac Catalyst I'm receiving "GLKit is deprecated and is not available when building for Mac" and "OpenGLES is deprecated and is not available when building for Mac" Errors. Any chance either of you could provide more insight on what you're doing to get around these errors for mac? Everything works great for iOS.

webbpage avatar Jan 22 '23 18:01 webbpage

For Mac Catalyst I'm receiving "GLKit is deprecated and is not available when building for Mac" and "OpenGLES is deprecated and is not available when building for Mac" Errors. Any chance either of you could provide more insight on what you're doing to get around these errors for mac? Everything works great for iOS.

There is no plan for macOs support.

hthetiot avatar Jan 23 '23 09:01 hthetiot

@hthetiot how many hours do you estimate for MacOS Capacitor support? I'd like to make a contribution to this effort. Also, please reach out to me via gbwebb at outlook dot com i have a feeling a paid hour webex with you would get me past my ios headache.

webbpage avatar Feb 10 '23 20:02 webbpage

@webbpage

how many hours do you estimate for MacOS Capacitor support?

I have no idea, ideally I would need to continue #748 and #427 to use the latest webrtc lib to facilitate the support for MacOS and Metal.

Also, please reach out to me via gbwebb at outlook dot com i have a feeling a paid hour webex with you would get me past my ios headache.

Email sent.

hthetiot avatar Feb 11 '23 11:02 hthetiot