azure-sdk-for-ios
azure-sdk-for-ios copied to clipboard
[BUG] Library not loaded: @rpath/AzureCommunicationCommon.framework/AzureCommunicationCommon
Describe the bug
When installing the AzureCommunicationCalling pod into an iOS app using use_frameworks! :linkage => :static
, the iOS app will crash with the following error:
dyld[1857]: Library not loaded: @rpath/AzureCommunicationCommon.framework/AzureCommunicationCommon
Referenced from: <434CCE2B-75C9-3FDB-B89F-6A64D3190D20> /private/var/containers/Bundle/Application/91B08186-EBDD-4331-801D-543E9ED4B3F1/MyTestApp.app/Frameworks/AzureCommunicationCalling.framework/AzureCommunicationCalling
Reason: tried: '/usr/lib/swift/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2), '/private/var/containers/Bundle/Application/91B08186-EBDD-4331-801D-543E9ED4B3F1/MyTestApp.app/Frameworks/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2), '/private/var/containers/Bundle/Application/91B08186-EBDD-4331-801D-543E9ED4B3F1/MyTestApp.app/Frameworks/AzureCommunicationCalling.framework/Frameworks/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2), '/usr/lib/swift/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2), '/private/var/containers/Bundle/Application/91B08186-EBDD-4331-801D-543E9ED4B3F1/MyTestApp.app/Frameworks/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2), '/usr/lib/swift/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2), '/private/var/containers/Bundle/Application/91B08186-EBDD-4331-801D-543E9ED4B3F1/MyTestApp.app/Frameworks/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2), '/private/preboot/Cryptexes/OS@rpath/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2), '/usr/lib/swift/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2), '/private/var/containers/Bundle/Application/91B08186-EBDD-4331-801D-543E9ED4B3F1/MyTestApp.app/Frameworks/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2), '/private/var/containers/Bundle/Application/91B08186-EBDD-4331-801D-543E9ED4B3F1/MyTestApp.app/Frameworks/AzureCommunicationCalling.framework/Frameworks/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2), '/usr/lib/swift/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2), '/private/var/containers/Bundle/Application/91B08186-EBDD-4331-801D-543E9ED4B3F1/MyTestApp.app/Frameworks/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2), '/usr/lib/swift/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2), '/private/var/containers/Bundle/Application/91B08186-EBDD-4331-801D-543E9ED4B3F1/MyTestApp.app/Frameworks/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2), '/System/Library/Frameworks/AzureCommunicationCommon.framework/AzureCommunicationCommon' (errno=2, not in dyld cache)
To Reproduce
- Create a new App in Xcode.
-
pod init
, then add the following, thenpod install
. Open the generated Xcode workspace.
target 'MyTestApp' do
use_frameworks! :linkage => :static
pod 'AzureCommunicationCalling', '2.3.0'
end
- Build will fail with
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.
- To resolve this, add a bridging header in Xcode with the following. The build will succeed.
#import <AzureCommunicationCalling/AzureCommunicationCalling.h>
- Launch the app on an iPhone. It crashes with the aforementioned stack trace.
Expected behavior
:linkage => :static
should work. Not all projects can use :linkage => :dynamic
, and there's an existing issue with omitting the use_frameworks!
line entirely ( https://github.com/Azure/azure-sdk-for-ios/issues/1517 ).
Setup
- macOS 13.3.1
- Xcode 14.3
- library version 2.3.0