首页 > 解决方案 > Swift pod 还不能集成为静态库

问题描述

我正在用 Flutter 构建一个应用程序。我在执行“pod install”时收到此错误消息,并且 pod 安装失败并停止。

错误信息:

[!] 以下 Swift pod 还不能集成为静态库:

Swift podDKPhotoGallery依赖于SDWebImageand SDWebImageFLPlugin,它们不定义模块。要选择生成模块映射的目标(在构建为静态库时需要从 Swift 导入它们),您可以use_modular_headers!在 Podfile 中全局设置,或指定:modular_headers => true特定的依赖项。

我应该在哪里设置“use_modular_headers!” 在 Podfile 中?谢谢!

标签: fluttercocoapods

解决方案


我尝试了解决方案。“使用框架!” 应在 'ios/Podfile' 中添加:

.
.
.
target 'Runner' do
      # Flutter Pod
    
      use_frameworks! #add here
    
      copied_flutter_dir = File.join(__dir__, 'Flutter')
      copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
      copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
.
.
.

推荐阅读