如何摆脱警告 Pod libs 安装

时间:2021-06-28 08:11:15

标签: xcode cocoapods

我是 iOS 新手。我有一个静态库项目 (Swift),我需要使用库 Swiftlint(有几种方法可以做到,我选择 Pod)

我是如何安装 pod 的:

https://medium.com/@soufianerafik/how-to-add-pods-to-an-xcode-project-2994aa2abbf1#

然后我在文件中定义了lib

# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'

target 'Effects_Lib' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Effects_Lib
  pod 'SwiftLint'

end

问题是当我尝试安装它时收到警告

Installing SwiftLint (0.43.1)
Generating Pods project
Integrating client project
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

[!] The Podfile contains framework or static library targets (Effects_Lib), for which the Podfile does not contain host targets (targets which embed the framework).
If this project is for doing framework development, you can ignore this message. Otherwise, add a target to the Podfile that embeds these frameworks to make this message go away (e.g. a test target).

我在 SO 上找到了这个答案:https://stackoverflow.com/a/54705782/5709159

也就是说我需要像这样将项目本身的路径添加到 pod 文件中(据我所知)

# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'

target 'Effects_Lib' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  project 'Effects_Lib.xcodeproj'

  # Pods for Effects_Lib
  pod 'SwiftLint'

end

但无论如何我得到了同样的警告。

我在这里做错了什么?

0 个答案:

没有答案