Closed setoelkahfi closed 1 week ago
Can you try to remove the .no_deps() call in src/metadata.rs (line 13) in the cargo swift code base?
It gives me different errors like the published cargo swift
one:
❯ ./.path-to-cargo-swift/target/debug/cargo-swift swift package
✔ Swift Package Name · CrateNetworking
✔ Select Target Platforms · iOS
✔ Building target iOS
cargo build --target aarch64-apple-ios
✔ Building target iOS Simulator
cargo build --target x86_64-apple-ios
cargo build --target aarch64-apple-ios-sim
mkdir -p target/universal-ios/debug
lipo target/x86_64-apple-ios/debug/libcrate_networking.a \
target/aarch64-apple-ios-sim/debug/libcrate_networking.a -create -output \
target/universal-ios/debug/libcrate_networking.a
⠂ Generating Swift bindings... thread 'main' panicked at /Users/setoelka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/uniffi_bindgen-0.28.1/src/interface/mod.rs:1126:14:
unknown throw type: Some(External { module_path: "crate_error_codes", name: "ErrorResponse", namespace: "crate_error_codes", kind: DataClass, tagged: false })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Can you give context why this was closed? @setoelkahfi
@antoniusnaumann I moved all my data models to the same crate with the networking layer. It sounds counterintuitive but works like a charm with cargo swift
.
Not sure if this is an issue with
uniffi
,cargo swift
, or my setup. Repost https://github.com/mozilla/uniffi-rs/issues/2225I have a networking crate that depends on a
crate_error_codes
crate and uses cargo swift to generate the swift package of the networking crate. I got an error while generating Swift binding with thecargo swift package
command:But I ran the same command directly from the
crate_error_codes
itself without issue. Below is my data structure:Cargo.toml
Any pointers?