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

Framework no longer working in Xcode 12.3 #64

Closed
iturrajoel opened this issue Dec 15, 2020 · 12 comments
Closed

Framework no longer working in Xcode 12.3 #64

iturrajoel opened this issue Dec 15, 2020 · 12 comments

Comments

@iturrajoel
Copy link

Xcode 12.3 is no longer working with Twilio.framework, the official help says:

"The only correct way to resolve this is to rebuild the framework as an XCFramework."

Please, provide ASAP a fix.

@bobiechen-twilio
Copy link
Contributor

Hi @iturrajoel

Can you provide more detail about the problem you are running into? I am assuming it's something similar to issue #422 in the quickstart repo.
I have just tried building the quickstart with Xcode 12.3 and the latest SDK, and it worked for me.

@iturrajoel
Copy link
Author

Hi,

Yes, it's the same issue #422, but I think here was a better place to report the issue.

If you have access to the Apple developer forum, you will read that many frameworks are having similar problems with the latest Xcode 12.3 (the final version, not the beta).

You can check this thread:

[https://developer.apple.com/forums/thread/669411]

The right answer to the problem seems to be:

This framework isn't built with a supported configuration -- iOS and iOS Simulator code has never been supported in the same binary. The linker in Xcode 11 began identifying these incorrect configurations and issuing warnings, and Xcode 12 goes further in identifying these issues.
The only correct way to resolve this is to rebuild the framework as an XCFramework. If this is your framework, or owned by another group in your company, follow the information in the video and the Xcode Help article.
If this framework is from a vendor, then you need to work with the vendor to get an updated version of the framework built with supported configuration.
In the discussion of this thread, there is a build script that attempts to resolve this error. Scripts like that -- anything that tries to manipulate the output with commands like lipo -- still produces an unsupported configuration in the binary. XCFrameworks are the way to go.

I have macOS 10.15.7 and Xcode 12.3 with an App for iOS 14.3.

@ryanthon
Copy link

Is it possible to get an XCFramework build for this SDK ASAP? It is blocking us from using Xcode 12.3.
We do not use Carthage or Cocoapods, we are using the .framework file directly.

@piyushtank
Copy link
Contributor

piyushtank commented Dec 17, 2020

@ryanthon Yes, we are going to start working on XCFramework support for Voice iOS SDK in the next sprint, so we should be able to ship xcframework in January 2021. We will keep you posted.

@iturrajoel
Copy link
Author

@piyushtank thank you. I hope you can give a highest priority, we are stuck in the Xcode 12.3 beta.

@ryanthon
Copy link

ryanthon commented Dec 17, 2020

@piyushtank Thank you for the update.

@iturrajoel

For anyone that needs a working version now, I was actually able to build an XCFramework that works with Xcode 12.3 using the following steps/commands.

  1. Use the following commands to create arm64 and x86_64 versions of the Framework.
mkdir arm64
mkdir x86_64
cp -R TwilioVoice.framework arm64/TwilioVoice.framework
cp -R TwilioVoice.framework x86_64/TwilioVoice.framework
cd arm64
lipo -remove x86_64 -output TwilioVoice.framework/TwilioVoice ./TwilioVoice.framework/TwilioVoice
cd ../x86_64
lipo -remove arm64 -output TwilioVoice.framework/TwilioVoice ./TwilioVoice.framework/TwilioVoice
cd ..
  1. At this point, you will need to modify the Info.plist file located at x86_64/TwilioVoice.framework/Info.plist, and change the value of the single element in the CFBundleSupportedPlatforms key from iPhoneOS to iPhoneSimulator.

  2. Run the following command to generate an XCFramework file.

xcodebuild -create-xcframework -framework arm64/TwilioVoice.framework -framework x86_64/TwilioVoice.framework -output TwilioVoice.xcframework

@iturrajoel
Copy link
Author

iturrajoel commented Dec 17, 2020

Thank you @ryanthon , I'll try it tomorrow morning.

Edit: It works perfect, thank you so so much.

@evnik
Copy link

evnik commented Dec 31, 2020

I've built this script, based on the steps provided by @ryanthon. Would be great if someone can check if it works fine for their project

@ceaglest
Copy link

Hello Developers,

Thank you for providing a solution to package an XCFramework from existing Twilio Voice releases.

We hear you that official support is a top priority issue and we will continue to work on this in January.

Best,
Chris

@carlosefonseca
Copy link

Hi! Sorry to bring this up again. Is there any update on XCFramework/SPM? Thanks!

@bobiechen-twilio
Copy link
Contributor

Hi everyone,

We are happy to inform you that we have just released the Voice iOS SDK 6.2.0, which is delivered as XCFramework. Please use the twilio-voice-ios repository and integrate the SDK into your app using the Swift Package Manager.

Cheers,
-bobie

@iturrajoel
Copy link
Author

Thank you, it seems to work fine, but when are you going to support the simulator in Apple Silicon?

I just upgraded my 8 years old mac just to find out that I can't use the simulator anymore because the Twilio framework :(

Any suggestions will be much appreciated.

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

7 participants