Flutter异常Couldn‘t find dynamic library in default locations

Flutter项目在Windows系统使用ffigen生成代码时报下面的错误:

SEVERE : Couldn't find dynamic library in default locations.

SEVERE : Please supply one or more path/to/llvm in ffigen's config under the key 'llvm-path'.

Unhandled exception:

Exception: Couldn't find dynamic library in default locations.

#0 findDylibAtDefaultLocations (package:ffigen/src/config_provider/spec_utils.dart:371:3)

#1 Config._getRootConfigSpec.<anonymous closure> (package:ffigen/src/config_provider/config.dart:231:35)

#2 HeterogeneousMapConfigSpec._extractNode (package:ffigen/src/config_provider/config_spec.dart:320:16)

#3 ConfigSpec.extract (package:ffigen/src/config_provider/config_spec.dart:86:12)

#4 new Config.fromYaml (package:ffigen/src/config_provider/config.dart:192:22)

#5 new Config.fromFile (package:ffigen/src/config_provider/config.dart:201:19)

#6 getConfigFromCustomYaml (package:ffigen/src/executables/ffigen.dart:126:17)

#7 getConfig (package:ffigen/src/executables/ffigen.dart:78:14)

#8 main (package:ffigen/src/executables/ffigen.dart:48:14)

参考ffigen文档 ,安装LLVM以及Visual Studio(主要是下载C++),然后在ffigen.yaml文件中配置LLVM路径

复制代码
llvm-path:
  - 'D:\LLVM'
相关推荐
程序员老刘6 小时前
跨平台开发地图 | 2026年6月
flutter·ai编程·客户端
悟空瞎说1 天前
Flutter 架构详解:新手必懂底层原理
flutter
SoaringHeart1 天前
Flutter最佳实践:IM聊天文字链接自动识别跳转
前端·flutter
恋猫de小郭1 天前
KMP / CMP 鸿蒙版本 Beta 发布,他有什么特别之处?
android·前端·flutter
风华圆舞2 天前
Flutter + 鸿蒙 Intents Kit:页面直达能力的完整接入方案
flutter·ui·华为·harmonyos
韩曙亮2 天前
【Flutter】Flutter 组件 ④ ( 组件渲染 的 三棵树理论 | Widget 树 → Element 树 → RenderObject 树 )
flutter·element·widget·renderobject
恋猫de小郭2 天前
Android 17 正式版发布,全新 AI 和各种破坏性更新
android·前端·flutter
kingbal2 天前
Windows:flutter环境搭建
windows·flutter
911hzh2 天前
Flutter MethodChannel 跨端通信框架 zh_native_channel:快速入门、优势分析与 Pigeon 对比
flutter
911hzh2 天前
Flutter 快速搭建新项目:用 Flutter Foundation Kit 一条命令生成带基础架构的 App 模板
flutter