链接到Cocoapod的静态框架在主项目中找不到

时间:2023-01-13 20:36:56

I'm trying to add a static framework (Moya) to my private Cocoapod project through Carthage.

我正在尝试通过Carthage向我的私人Cocoapod项目添加一个静态框架(Moya)。

My goal is to include Moya as a static framework in my private Cocoapod (SwiftModel) and use Moya as well in my main project (as SwiftModel has a dependency to it).

我的目标是在我的私有Cocoapod(SwiftModel)中包含Moya作为静态框架,并在我的主项目中使用Moya(因为SwiftModel具有依赖性)。

I've added Moya to my framework by doing the following steps:

我通过执行以下步骤将Moya添加到我的框架中:

  1. link framework in podspec file

    podspec文件中的链接框架

    s.vendored_frameworks = 'SwiftModel/Carthage/Build/iOS/Moya.framework'

    s.vendored_frameworks ='SwiftModel / Carthage / Build / iOS / Moya.framework'

  2. add Moya to private framework (Link Binary With Libraries)

    将Moya添加到私有框架(Link Binary With Libraries)

链接到Cocoapod的静态框架在主项目中找不到

So inside my Pods project it looks like this:

所以在我的Pods项目中它看起来像这样:

链接到Cocoapod的静态框架在主项目中找不到

Trying to add the path to "Framework Header Search Path" did not made any changes. I've tried to add it in the main project and in pods project.

尝试添加“框架头搜索路径”的路径没有做任何更改。我试图在主项目和pods项目中添加它。

When just building the private pod everything works fine and Moya is recognized. However if I want to build the main project (that includes my private pod) I'm always getting this error:

当只是建造私人吊舱时,一切正常,Moya被认可。但是,如果我想构建主项目(包括我的私有pod),我总是会收到此错误:

framework not found Moya for architecture arm64

框架未找到Moya for architecture arm64

链接到Cocoapod的静态框架在主项目中找不到

1 个解决方案

#1


2  

As your error states that

正如你的错误所述

framework not found Moya for architecture arm64

框架未找到Moya for architecture arm64

It means that Moya is not available for arm64 architecture, but your main project has following architectures;- arm64, armv7, armv7s. Remove the arm64 from your main project's valid architecture.

这意味着Moya不适用于arm64架构,但您的主要项目有以下架构: - arm64,armv7,armv7s。从主项目的有效架构中删除arm64。

  • Also try to add -Objc in other link flags.
  • 还尝试在其他链接标志中添加-Objc。
  • Try adding libz to the link library section of you project
  • 尝试将libz添加到项目的链接库部分

iOS Support matrix:-

iOS支持矩阵: -

链接到Cocoapod的静态框架在主项目中找不到

#1


2  

As your error states that

正如你的错误所述

framework not found Moya for architecture arm64

框架未找到Moya for architecture arm64

It means that Moya is not available for arm64 architecture, but your main project has following architectures;- arm64, armv7, armv7s. Remove the arm64 from your main project's valid architecture.

这意味着Moya不适用于arm64架构,但您的主要项目有以下架构: - arm64,armv7,armv7s。从主项目的有效架构中删除arm64。

  • Also try to add -Objc in other link flags.
  • 还尝试在其他链接标志中添加-Objc。
  • Try adding libz to the link library section of you project
  • 尝试将libz添加到项目的链接库部分

iOS Support matrix:-

iOS支持矩阵: -

链接到Cocoapod的静态框架在主项目中找不到