Open tinyjin opened 6 months ago
Previously, iOS binary is built with lipo (Fat Binary). In the Fat Binary, simulator binary for Apple Silicon cannot be merged in single binary due to the same architecture with iPhone OS.
The ideal approach is to build a xcframework
, which is more optimal and suitable as a universal binary.
Frameworks/libthorvg.xcframework
# lottie_thorvg.podspec
s.vendored_frameworks = 'Frameworks/libthorvg.xcframework'
We can build them via script:
# Universal sim binary
lipo path/to/ios-simulator/aarch64/libthorvg.dylib \
path/to/ios-simulator/x86_64/libthorvg.dylib \
-output libthorvg.dylib -create
# Build xcframework
xcodebuild -create-xcframework \
-library path/to/ios/libthorvg.dylib \
-library path/to/ios-simulator/libthorvg.dylib \
-output libthorvg.xcframework
Installation bug from building with iOS Simulator hosted by M1 (SoC) Probably,
dylib
for ios-sim on arm64 is missing.