Hi Guys,
I have a project that I cross compile to Android and iOS dynamic (cdylib).
For Android I package the libs into a JNI wrapped AAR and that works great .
For iOS I package the generated dylib
's into a universal framework and works great for simulators and real devices.
However as of recent whenever I try to compile the library for targets aarch64-apple-ios
or x86_64-apple-ios
using a command:
cargo build -p my_project --target aarch64-apple-ios --release
i get an error:
error: cannot produce cdylib for 'sifir-ios v0.1.0 (/MyProject)' as the target
aarch64-apple-ios does not support these crate types
Which is totally new and use to work fine.
Note: That i can compile a static lib (.a) fine but the problem with the static lib vs dynamic lib are sizes , a universal static lib is around ~88megs, while the universal dylib is ~9megs! Which is huge difference for mobile context.
Did something change recently ? Any pointers to why this is happening all of a sudden ? Would really appreciate any pointers
I'm on:
rustc 1.49.0 (e1884a8e3 2020-12-29)
targets installed:
x86_64-apple-darwin (installed)
x86_64-apple-ios (installed)
aarch64-apple-ios (installed)
and a link to the project if it helps:
https://github.com/Sifir-io/sifir-rs-sdk/tree/main/sifir-ios