Summary
When sqlite_vector is used from a Flutter app on iOS simulator, the native-asset build hook returns the same fat simulator dylib for both arm64 and x86_64 targets. Flutter then tries to package those outputs together and fails during the simulator build.
Package Version
Environment
- Flutter 3.41.2
- Xcode 26.1.1
- iOS simulator build (
just build ios --simulator --no-codesign in our case, but this is a normal Flutter iOS simulator build)
Failure
Flutter fails during iOS simulator packaging with an error like:
Target install_code_assets failed: Error: Failed to create universal binary:
fatal error: .../usr/bin/lipo: .../vector_ios-sim.dylib and .../vector_ios-sim.dylib have the same architectures (x86_64) and can't be in the same fat output file
Root Cause
The current hook returns native_libraries/ios-sim/vector_ios-sim.dylib for every iOS simulator build, regardless of target architecture:
- simulator
arm64 build -> ios-sim/vector_ios-sim.dylib
- simulator
x86_64 build -> ios-sim/vector_ios-sim.dylib
That file is already a fat dylib containing both architectures, so Flutter ends up trying to combine duplicate inputs.
We confirmed this by inspecting the hook outputs for both simulator targets: both originally pointed at the same vector_ios-sim.dylib.
What Fixed It Locally
We patched the build hook so that for iOS simulator builds it thins the fat dylib per target architecture and emits an arch-specific output file:
arm64 -> vector_ios_sim_arm64.dylib
x86_64 -> vector_ios_sim_x86_64.dylib
After that, the Flutter iOS simulator build succeeded.
Suggested Fix
In hook/build.dart, for OS.iOS + simulator targets, emit an architecture-specific dylib instead of returning the same fat simulator binary for every target.
If helpful, I can open a PR with the hook change we tested locally.
Summary
When
sqlite_vectoris used from a Flutter app on iOS simulator, the native-asset build hook returns the same fat simulator dylib for botharm64andx86_64targets. Flutter then tries to package those outputs together and fails during the simulator build.Package Version
sqlite_vector0.9.85Environment
just build ios --simulator --no-codesignin our case, but this is a normal Flutter iOS simulator build)Failure
Flutter fails during iOS simulator packaging with an error like:
Root Cause
The current hook returns
native_libraries/ios-sim/vector_ios-sim.dylibfor every iOS simulator build, regardless of target architecture:arm64build ->ios-sim/vector_ios-sim.dylibx86_64build ->ios-sim/vector_ios-sim.dylibThat file is already a fat dylib containing both architectures, so Flutter ends up trying to combine duplicate inputs.
We confirmed this by inspecting the hook outputs for both simulator targets: both originally pointed at the same
vector_ios-sim.dylib.What Fixed It Locally
We patched the build hook so that for iOS simulator builds it thins the fat dylib per target architecture and emits an arch-specific output file:
arm64->vector_ios_sim_arm64.dylibx86_64->vector_ios_sim_x86_64.dylibAfter that, the Flutter iOS simulator build succeeded.
Suggested Fix
In
hook/build.dart, forOS.iOS+ simulator targets, emit an architecture-specific dylib instead of returning the same fat simulator binary for every target.If helpful, I can open a PR with the hook change we tested locally.