{"record":{"id":"386e5c50d64fb6e6","repo":"DioxusLabs/dioxus","slug":"expected-abi-string-e-g-extern-swift","errorCode":null,"errorMessage":"Expected ABI string (e.g., extern \"Swift\")","messagePattern":"Expected ABI string \\(e\\.g\\., extern \"Swift\"\\)","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"packages/manganis/manganis-macro/src/ffi.rs","lineNumber":297,"sourceCode":"impl FfiBridgeParser {\n    /// Parse the attribute and item together\n    pub fn parse_with_attr(attr: FfiAttribute, item: ItemForeignMod) -> syn::Result<Self> {\n        let source_path = attr.source_path;\n\n        // Determine the ABI\n        let abi = match &item.abi.name {\n            Some(name) => match name.value().as_str() {\n                \"Swift\" => ForeignAbi::Swift,\n                \"Kotlin\" => ForeignAbi::Kotlin,\n                other => {\n                    return Err(syn::Error::new(\n                        name.span(),\n                        format!(\"Unsupported ABI: {}. Expected 'Swift' or 'Kotlin'\", other),\n                    ));\n                }\n            },\n            None => {\n                return Err(syn::Error::new(\n                    item.abi.extern_token.span,\n                    \"Expected ABI string (e.g., extern \\\"Swift\\\")\",\n                ));\n            }\n        };\n\n        let mut types = Vec::new();\n        let mut functions = Vec::new();\n\n        for item in &item.items {\n            match item {\n                ForeignItem::Type(ty) => {\n                    types.push(ForeignTypeDecl {\n                        name: ty.ident.clone(),\n                    });\n                }\n                ForeignItem::Fn(func) => {\n                    functions.push(ForeignFunctionDecl::from_foreign_fn(func)?);","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/manganis/manganis-macro/src/ffi.rs#L279-L315","documentation":"`parse_with_attr` errors when the extern block has no ABI name at all. FFI blocks processed by the manganis macro must declare `extern \"Swift\"` or `extern \"Kotlin\"` so the bridge generator knows the target language.","triggerScenarios":"Thrown at packages/manganis/manganis-macro/src/ffi.rs:297 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the ABI as a string literal, e.g. extern \"Swift\"."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}