与可可豆一起在迅速地进口框架

时间:2021-07-23 05:00:46

I am new to Swift, but I learned the basics. I wanted to import a framework but I ran into issues. I will now explain what steps I followed and what failed.

我是斯威夫特的新手,但我学到了基本知识。我想导入一个框架,但遇到了一些问题。现在我将解释我所遵循的步骤和失败之处。

  1. I installed cocoapods by using terminal command: sudo gem install cocoapods
  2. 我使用终端命令:sudo gem安装cocoapods来安装cocoapods
  3. I then navigated to my projects root directory with terminal then used command: pod init
  4. 然后我用终端导航到我的项目根目录,然后使用命令:pod init
  5. It created a podfile, and I edited it as I have shown below.

    它创建了一个播客文件,我编辑了它,如下所示。

    platform :ios, '8.0' use_frameworks!

    ios平台:,“8.0”use_frameworks !

    target 'Testy' do

    目标“暴躁的”

    end

    结束

    target 'TestyTests' do

    目标“TestyTests”做的

    pod 'Kingfisher', '~> 1.8.1'

    豆荚“翠鸟”、“~ > 1.8.1 '

    end

    结束

    target 'TestyUITests' do

    目标“TestyUITests”做的

    pod 'Kingfisher', '~> 1.8.1'

    豆荚“翠鸟”、“~ > 1.8.1 '

    end

    结束

  6. I then closed xcode and started the project by clicking 'Testy.xcworkspace' file.

    然后我关闭了xcode,点击“Testy”开始了这个项目。xcworkspace”文件。

  7. At this point, I did not add any code, just built the project without issues, problems start here.
  8. 此时,我没有添加任何代码,只是构建了一个没有问题的项目,问题从这里开始。
  9. When i try to import my framework and build, it gives the follow error:

    当我尝试导入我的框架并构建时,它会给出以下错误:

    Cannot load underlying module for 'Kingfisher'

    无法加载“翠鸟”的底层模块

  10. So what might be the problem here? If you need additional info, ask me and I can provide.

    那么这里的问题是什么呢?如果你需要更多的信息,可以问我,我可以提供。

1 个解决方案

#1


1  

In your Podfile, you do not have "pod 'Kingfisher', '~> 1.8.1'" listed for the target "Testy".

在你的播客中,你没有为目标“暴躁”列出“pod”“翠鸟”,“~> 1.8.1”。

#1


1  

In your Podfile, you do not have "pod 'Kingfisher', '~> 1.8.1'" listed for the target "Testy".

在你的播客中,你没有为目标“暴躁”列出“pod”“翠鸟”,“~> 1.8.1”。