Cordova-plugin-iosrtc: [8.0.0 RC2] Apple Store Submission - stripping simulator (i386/x86_64) archs won't work anymore

Created on 11 Sep 2020  路  4Comments  路  Source: cordova-rtc/cordova-plugin-iosrtc

  • [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. sample code or updated extra/renderer-and-libwebrtc-tests.js file).
  • [X] I have provided third party library name and version, ios, Xcode and plugin version and adapter.js version if used.

Versions affected

  • Cordova version (e.g 7.1.0): 9 and 10
  • Cordova iOS version (e.g 5.1.0): 6.1.0
  • Plugin version (e.g 6.0.12): 8.0.0 RC2
  • iOS version (e.g 10.2): 13
  • Xcode version (e.g 11.1 - 11A1027): 11.7
  • WebRTC-adapter version (e.g. 7.4.0): latest
  • WebRTC Framework version (e.g. JSSip 3.1.2):

Description

The script to strip down Unsupported Architectures is not doing its job anymore, it's running and give this error message after a fresh install of the 8.0.0 RC2

Error: Command failed: lipo -extract i386 WebRTC -o WebRTC-i386
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: -extract i386 specified but fat file: WebRTC does not contain that architecture

Steps to reproduce

Just follow the doc when it comes to Apple Submission:
https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/docs/Building.md#apple-store-submission

Expected results

We expect the command:
file platforms/ios/Bandcast/Plugins/cordova-plugin-iosrtc/WebRTC.framework/WebRTC

To Give:

Mach-O universal binary with 1 architecture: [arm64:Mach-O 64-bit dynamically linked shared library arm64]
platforms/ios/Bandcast/Plugins/cordova-plugin-iosrtc/WebRTC.framework/WebRTC (for architecture arm64):  Mach-O 64-bit dynamically linked shared library arm64

Actual results

plugins/cordova-plugin-iosrtc/lib/WebRTC.framework/WebRTC: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm64]
plugins/cordova-plugin-iosrtc/lib/WebRTC.framework/WebRTC (for architecture x86_64):    Mach-O 64-bit dynamically linked shared library x86_64
plugins/cordova-plugin-iosrtc/lib/WebRTC.framework/WebRTC (for architecture arm64):     Mach-O 64-bit dynamically linked shared library arm64

Workaround

cd plugins/cordova-plugin-iosrtc/lib/WebRTC.framework
lipo -remove x86_64 WebRTC -o WebRTC
cordova platform remove ios
cordova platform add ios@latest
file platforms/ios/Bandcast/Plugins/cordova-plugin-iosrtc/WebRTC.framework/WebRTC

Mach-O universal binary with 1 architecture: [arm64:Mach-O 64-bit dynamically linked shared library arm64]
platforms/ios/Bandcast/Plugins/cordova-plugin-iosrtc/WebRTC.framework/WebRTC (for architecture arm64):  Mach-O 64-bit dynamically linked shared library arm64
bug

All 4 comments

Thank you @numerized I will check

This works for me using the provided script after that fix, since V8 does not include i386 and armv7 anymore.

https://github.com/cordova-rtc/cordova-plugin-iosrtc/pull/545/commits/ded470fdb7c4ee62d5795cd0af52c64449ab63fe

node plugins/cordova-plugin-iosrtc/extra/ios_arch.js --extract
node plugins/cordova-plugin-iosrtc/extra/ios_arch.js --device
node plugins/cordova-plugin-iosrtc/extra/ios_arch.js --clean

haroldthetiot@Harolds-MacBook-Pro cordova-plugin-iosrtc-sample % node plugins/cordova-plugin-iosrtc/extra/ios_arch.js --list
List WebRTC architectures...
WebRTC: Mach-O universal binary with 1 architecture: [arm64:Mach-O 64-bit dynamically linked shared library arm64]
WebRTC (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64

Reference: https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/docs/Building.md#strip-simulator-archs-usage

I confirm travis was failing silently on v8, V7 was ok.

V8 Prior ded470f

Screenshot 2020-09-11 at 12 57 00

https://travis-ci.org/github/cordova-rtc/cordova-plugin-iosrtc/jobs/714800345#L1849

V7 still include i386 and armv7

Screenshot 2020-09-11 at 12 57 12

https://travis-ci.org/github/cordova-rtc/cordova-plugin-iosrtc/jobs/714800177#L1869

Thank you @numerized

Was this page helpful?
0 / 5 - 0 ratings