Description
Description
When apple platform (ios
, macos
, tvos
) build scripts enable an external library that requires expat
, build scripts are linked against the libexpat
system library that comes with the newer SDK versions.
First reported in https://github.com/tanersener/ffmpeg-kit-test/issues/18
Expected behavior
Linked libraries should work on all platforms.
Current behavior
Unfortunately, older system runtimes e.g. iOS 13.5 don't have libexpat
. So, they fail to load ffmpeg
libraries.
To Reproduce
- Run
ios.sh
by enabling eitherfontconfig
orlibass
- Start your application on iOS SDK 13.5
Logs
dyld: Library not loaded: /usr/lib/libexpat.1.dylib
Referenced from: /Users/taner/Library/Developer/CoreSimulator/Devices/5D5AD397-2408-4E70-9308-28E80DF86065/data/Containers/Bundle/Application/2D2FC5FC-E951-4721-9338-6B4BE0F3C7AB/FFmpegKitIOS.app/Frameworks/libavdevice.framework/libavdevice
Reason: image not found
dyld: launch, loading dependent libraries
Environment
- Platform:
iOS
/macOS
/tvOS
- Architecture:
armv7
,armv7s
,arm64
,arm64-mac-catalyst
,arm64-simulator
,arm64e
,i386
,x86-64
,x86-64-mac-catalyst
- Version:
v4.5.1
andv4.5.1.LTS
- Source branch:
main
- Xcode version:
13.2.1
- Cocoapods version:
1.11.2
Other
This happens because Apple platforms try to load dynamic libraries first. Since there is a dynamic libexpat.1.dylib
library found in search paths, they ignore the static binary built by ios.sh
, macos.sh
and tvos.sh
.
This behaviour is explained in QA1393.