DioxusLabs/dioxus · error · syn::Error

Unsupported ABI: . Expected 'Swift' or 'Kotlin

Error message

Unsupported ABI: {}. Expected 'Swift' or 'Kotlin'

What it means

`parse_with_attr` inspects the extern block's ABI name and only supports `extern "Swift"` and `extern "Kotlin"`; any other ABI string produces this compile error naming the unsupported ABI and the two valid options.

Solutions

  1. Use extern "Swift" or extern "Kotlin" as the ABI; other ABI strings are not supported.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/manganis/manganis-macro/src/ffi.rs:290 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of DioxusLabs/dioxus@24f6a829df (2026-08-23). Data as JSON: /api/errors/b6c84e525a5840fe. Report an issue: GitHub.

Appendix: source

Thrown at packages/manganis/manganis-macro/src/ffi.rs:290

        let lit: LitStr = input.parse()?;
        Ok(FfiAttribute {
            source_path: lit.value(),
        })
    }
}

impl FfiBridgeParser {
    /// Parse the attribute and item together
    pub fn parse_with_attr(attr: FfiAttribute, item: ItemForeignMod) -> syn::Result<Self> {
        let source_path = attr.source_path;

        // Determine the ABI
        let abi = match &item.abi.name {
            Some(name) => match name.value().as_str() {
                "Swift" => ForeignAbi::Swift,
                "Kotlin" => ForeignAbi::Kotlin,
                other => {
                    return Err(syn::Error::new(
                        name.span(),
                        format!("Unsupported ABI: {}. Expected 'Swift' or 'Kotlin'", other),
                    ));
                }
            },
            None => {
                return Err(syn::Error::new(
                    item.abi.extern_token.span,
                    "Expected ABI string (e.g., extern \"Swift\")",
                ));
            }
        };

        let mut types = Vec::new();
        let mut functions = Vec::new();

        for item in &item.items {
            match item {

View on GitHub (pinned to 24f6a829df)