无法在多 iproject 工作区中加载 'Lottie' 的基础模块

Cannot load underlying module for 'Lottie' in a mult-iproject workspace

我正在学习 clean swift 的教程 但是现在我在使用 cocoapods 时遇到了问题。总之,我在 运行 pod init 之后创建了一个工作区,然后添加了 3 个项目:表示层、领域层和数据层。

正如您在图片中看到的,RadarAir-15 是原始项目(在 运行 pod init 之前)。

播客文件

platform :ios, '13.6'    
workspace 'RadarAIR-15'

target 'RadarAIR-15' do
  xcodeproj 'RadarAIR-15.xcodeproj'
  
end
target 'PresentationRadarAir' do
  xcodeproj 'PresentationRadarAir/PresentationRadarAir.xcodeproj'
  pod 'lottie-ios'
end

在我只想为表示层添加一个 Pod 之前,一切似乎都很好,在这种情况下,我想使用 Lottie。 但我收到此错误:

<unknown>:0: error: cannot load underlying module for 'Lottie'

而且我也不能使用 IBDesignable。

更新

我让它工作,将依赖项添加到主要目标中的 pod:RadarAIR-15

target 'RadarAIR-15' do
    project 'RadarAIR-15'
    pod 'lottie-ios'
end
target 'PresentationRadarAir' do
#    use_frameworks! :linkage => :static
    project 'PresentationRadarAir/PresentationRadarAir'
    pod 'lottie-ios'
end

这只是一个解决方法,因为故事板 (xib) 仍然有相同的错误,我想避免将依赖项添加到主要目标。但至少 Lottie 是按代码工作的。 有没有办法消除这个故事板 (xib) 错误?

最后我不得不添加 use_frameworks! :linkage => :static,我所有的问题都消失了:)

platform :ios, '13.6'

workspace 'RadarAIR-15'

target 'RadarAIR-15' do
     project 'RadarAIR-15'
end
target 'PresentationRadarAir' do
    use_frameworks! :linkage => :static
    project 'PresentationRadarAir/PresentationRadarAir'
    pod 'lottie-ios'
    pod 'Hero'
    pod 'MaterialComponents'

end
target 'DataRadarAir' do
    use_frameworks! :linkage => :static
    project 'DataRadarAir/DataRadarAir'
    pod 'Firebase/Auth'
    pod 'Firebase/Firestore'
end