Skip to content

[native_toolchain_rust] Compilation error when adding a dependency #17

Closed
@Rahiche

Description

@Rahiche

I'm using native_toolchain_rust to create a package, the sample example in the repo builds with no issues.

I add any dependency (for example: image = "0.25.2") and it can no longer compile, and I'm trying to find where I can get the logs to debug the issue, any advice on how should I debug this.

Xcode build done.                                           15.4s
Failed to build iOS app
Error (Xcode): Building native assets for package:flutter_package failed.

Error (Xcode): linking with `cc` failed: exit status: 1

Error (Xcode): linker command failed with exit code 1 (use -v to see invocation)
/Users/raouf/Documents/GitHub/native_toolchain_rust/example/flutter_package/example/ios/%20%20%20%20%20%20%20%20%20%20clang:0:0

Error (Xcode): could not compile `rayon-core` (build script) due to 1 previous error

Error (Xcode): could not compile `proc-macro2` (build script) due to 1 previous error

Error (Xcode): could not compile `crossbeam-utils` (build script) due to 1 previous error

Error (Xcode): could not compile `anyhow` (build script) due to 1 previous error

Error (Xcode): could not compile `paste` (build script) due to 1 previous error

Error (Xcode): could not compile `thiserror` (build script) due to 1 previous error

Could not build the application for the simulator.
Error launching application on iPhone 15 Pro.

To reproduce just update cargo.toml, flutter clean and then build again:

[package]
name = "flutter_ffi_plugin"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["cdylib"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
image = "0.25.2"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions