Azure / azure-sdk-for-ios

iOS client SDKs for Microsoft Azure
https://azure.github.io/azure-sdk-for-ios/
MIT License
188 stars 90 forks source link

[FEATURE REQ] AzureCommunicationCalling - Swift 5.7 support #1403

Open jpamarohorta opened 1 year ago

jpamarohorta commented 1 year ago

Is your feature request related to a problem? Please describe. We are unable to use the SDK with the most recent Xcode (14.1) and Swift 5.7.

Describe the solution you'd like A version of the SDK that would be compatible with Swift 5.7.

Describe alternatives you've considered We tried to change the toolchain used in this project by Xcode to Swift 5.6 however it caused issues with other dependencies on our app.

Additional context The error we are receiving when building with Swift 5.7 is: Failed to build module 'AzureCommunicationCalling'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)', while this compiler is 'Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51)'). Please select a toolchain which matches the SDK.

Information Checklist

tjprescott commented 1 year ago

Hi @jpamarohorta thanks for the report! @raosanat can you comment on here when you expect a compatible version of Calling to be released?

lucianopa-msft commented 1 year ago

Hi @jpamarohorta, Thanks for the report, how are you installing the SDK, and what version of SDK are you trying to install?

andycancado commented 1 year ago

i had the same error on Mac Mini M1, using Xcode in rosetta mode fixed the issue

jpamarohorta commented 1 year ago

Hello @lucianopa-msft , I'm installing via cocoapods and it was version 2.2.1

raosanat commented 1 year ago

@jpamarohorta how does your Podfile look like ? Can you send it here ?

lucianopa-msft commented 1 year ago

@jpamarohorta You are probably in a M1 Mac and trying to target a simulator right? The issue here is we indeed need to add support for arm simulator as right now we only ship ios-x86_64-simulator and iOS-arm64 in our xcframework. For now to unblock you, you can either build targeting a physical device or make Xcode run on rosetta(as @andycancado mentioned), which forces simulators to run as x86 simulators which ship a binary for. But we will work on shipping support for arm simulators in a future release.

rbuiten commented 1 year ago

i couldn't use version 2.2.2 (and 2.3.0-beta.4). Even with Rosetta mode enabled or just with a physical device. Will the frameworks be build with BUILD_LIBRARY_FOR_DISTRIBUTION set to YES? This will make the framework less dependent on specific swift version

lucianopa-msft commented 1 year ago

i couldn't use version 2.2.2 (and 2.3.0-beta.4). Even with Rosetta mode enabled or just with a physical device.

What are the errors you were seeing?

Will the frameworks be build with BUILD_LIBRARY_FOR_DISTRIBUTION set to YES? This will make the framework less dependent on specific swift version

Yes

rbuiten commented 1 year ago

sorry for the late response, but the error is the same as above

error: compiling for iOS 12.0, but module 'AzureCommunicationCommon' has a minimum deployment target of iOS 13.0: /Users/rbuiten/Library/Developer/Xcode/DerivedData/project-cuvhuaakbyehnodmsutkqpqtyckv/Build/Products/NL_ACC-iphoneos/AzureCommunicationCommon/AzureCommunicationCommon.framework/Modules/AzureCommunicationCommon.swiftmodule/arm64-apple-ios.swiftmodule

../CommunicationIdentifierExtension.swift:9:8: error: failed to build module 'AzureCommunicationCalling'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)', while this compiler is 'Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)'). Please select a toolchain which matches the SDK.

lucianopa-msft commented 1 year ago

Hi @rbuiten, the main error seems to be related to target error: compiling for iOS 12.0, but module 'AzureCommunicationCommon' has a minimum deployment target of iOS 13.0 can you check you minimum development targets?

rbuiten commented 1 year ago

hmm ok. I did update the minimum deployment target to 13. So, it's strange. But when I update the pod and set the deployment target to 12 it will work.

jpamarohorta commented 1 year ago

Hello, I'm currently having the same issue but now with Xcode 14.3 and Swift 5.8. I get the following error: Failed to build module 'AzureCommunicationCalling'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)', while this compiler is 'Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100)'). Please select a toolchain which matches the SDK.

Is there a solution for this type of issues or do we need to wait for a new release compatible with the latest swift? I'm using the latest pod 2.4.0.

lucianopa-msft commented 1 year ago

Hello, I'm currently having the same issue but now with Xcode 14.3 and Swift 5.8. I get the following error: Failed to build module 'AzureCommunicationCalling'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)', while this compiler is 'Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100)'). Please select a toolchain which matches the SDK.

Is there a solution for this type of issues or do we need to wait for a new release compatible with the latest swift? I'm using the latest pod 2.4.0.

Did 2.3.0 version worked? We ship with BUILD_LIBRARY_FOR_DISTRIBUTION so versions of the compiler shouldn't matter in that case. Are you trying to build targeting a simulator or a device? This message can also happen because we don't support M1 simulators yet.

ashfaqadib commented 9 months ago

@lucianopa-msft I'm facing the issue on my M1 computer and using a physical phone device:

Failed to build module 'AzureCommunicationCalling'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)', while this compiler is 'Apple Swift version 5.8.1 (swiftlang-5.8.0.124.5 clang-1403.0.22.11.100)'). Please select a toolchain which matches the SDK.

lucianopa-msft commented 9 months ago

Hi @ashfaqadib, Which version of Calling SDK are you using? As well as Xcode and Swift versions you are using Can you also share installation details, such as how are you installing the binary?

lucianopa-msft commented 9 months ago

Also if you are trying to build targeting simulator or device arch?

ashfaqadib commented 8 months ago

Hi @lucianopa-msft,

I'm currently using AzureCommunicationCalling (1.0.1) following the Voice Calling Quickstart guide. I'm on XCode Version 14.3.1 and Swift version 5.8.1. I'm trying to build on my physical device with iOS 12. I haven't still figured out a fix for the issue.

lucianopa-msft commented 8 months ago

Can you try with the latest version? 2.8.0? We still support iOS 12 in our latest releases so it would not be an issue

lucianopa-msft commented 8 months ago

If that doesn't work, can you submit a sample minimized project zip that repros this? This message may happen for a variety of reasons which some of them are not actually compiler version mismatch.