XCode 8.2.1错误-没有此类模块YouTubePlayer [英] XCode 8.2.1 error - No such module YouTubePlayer
问题描述
我正在使用 https://github.com/gilesvangruisen/Swift-YouTube-Player
首先,我尝试从任何地方手动导入它,包括拖放,复制,嵌入framewordks,嵌入式二进制文件,链接框架,但均未成功,并显示错误消息没有此类模块YouTubePlayer
First I've tried to import it manually from everywhere include dropping, copyng, embed framewordks, embedded binaries, linked frameworks, but it was unsuccessfully with error message No such module YouTubePlayer
接下来,我使用了椰子.安装它并从.xcworkspace运行它.然后尝试运行它,然后再次出现错误消息没有此类模块YoutubePlayer
Next I used cocoapods. Install it and run it from .xcworkspace. Then try to run it and again error message No such module YoutubePlayer
这是Pod安装后的列表树目录
This is list tree directories after pod install
也许这是解决方案,但我不知道回购在哪里以及如何执行所描述的操作. https://github.com/gilesvangruisen/Swift-YouTube-Player/issues/42
Maybe this is the solution, but I don't know where is repo and how to do the described action. https://github.com/gilesvangruisen/Swift-YouTube-Player/issues/42
推荐答案
使用cocoapod失败的原因是因为所写的pod是旧的swift版本.因此,除非我们没有成功编译Pod,否则我们将无法导入该Pod.您可以使用以下命令将旧的swift代码更改为新的代码:
The reason why its failing with cocoapod is because the pod written is in old swift version. So, unless until we don't compile the pod successfully, we can't import that. You can change the old swift code to new using :
Xcode-> Edit-> Convert->转换为当前的Swift语法
Xcode->Edit->Convert->To Current Swift Syntax
您还可以使用最新版本,并从您提到的存储库中构建框架: https://github.com/gilesvangruisen/Swift-YouTube-Player
Also you can use the latest release and build the framework from the repo you mentioned: https://github.com/gilesvangruisen/Swift-YouTube-Player
我下载了最新版本并创建了youTubePlayer框架,并将其链接到示例应用程序并能够导入它.
I downloaded the latest release and created the youTubePlayer framework and linked it to a sample app and able to import it.
请检查此链接,以获取具有YouTubePlayer框架以及您可以使用的示例应用在您自己的项目中.
Please check this link for the sample app which is having YouTubePlayer framework as well which you can use in your own project.
这篇关于XCode 8.2.1错误-没有此类模块YouTubePlayer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!