Pod安装GPUImage不起作用 [英] Pod install GPUImage does not work
问题描述
我正在使用 cocoapods 开发一个Swift项目.这是Podfile:
I am working on a Swift project with cocoapods. Here is Podfile:
pod 'GPUImage', '~> 0.1.4'
-
运行
pod install
后,我尝试得到有关导入文件的错误:
After i run
pod install
, i try got the error about import file:
导入GPUImage
import GPUImage
我从podfile中卸载了GPUImage,然后尝试第二种解决方案,但出现了不同的错误.
I uninstalled GPUImage from podfile, then try the second solution, i got different error.
This link is the project instruction on github. My steps are:
-
将GPUImage.xcodeproj复制并粘贴到项目根目录中,并将其添加到我的项目中.
Copy&Paste GPUImage.xcodeproj into project root directory, and added it into my project.
转到"构建设置"->"构建阶段"->"目标依赖项",已添加 PUImageFramework ,在与库链接二进制文件部分中,添加了 GPUImage.framework .
Go to "Build settings" -> "Build Phases" -> "Target Dependencies", added PUImageFramework, in Link Binary With Libraries section, added GPUImage.framework.
但是我遇到了一个错误:
But i got an error:
error: unable to read module map contents from 'Source/iOS/Framework/module.modulemap': Error Domain=NSCocoaErrorDomain Code=260 "The file "module.modulemap" couldn’t be opened because there is no such file." UserInfo=0x7f872cfb0b80 {NSFilePath=/Users/william/A/muguang-ios/Source/iOS/Framework/module.modulemap, NSUnderlyingError=0x7f87413f4dd0 "The operation couldn’t be completed. No such file or directory"}
任何帮助,谢谢!
现在的错误是:
dyld: Library not loaded: @rpath/GPUImage.framework/GPUImage
Referenced from: /private/var/mobile/Containers/Bundle/Application/9CF1D10C-1D78-40CB-955F-19110B3C3EA8/testGDU.app/testGDU
Reason: image not found
编辑: 对于不使用Pod的解决方案,以下是解决方案:
EDIT: For solution without using pods, here is solution:
然后,您需要添加一个新的复制文件"构建阶段,并设置目标" 到Frameworks,然后向其中添加GPUImage.framework构建产品. 这将使框架与您的应用程序捆绑在一起 (否则,您将看到神秘的"dyld:未加载库: @ rpath/GPUImage.framework/GPUImage"在执行时出错).
You then need to add a new Copy Files build phase, set the Destination to Frameworks, and add the GPUImage.framework build product to that. This will allow the framework to be bundled with your application (otherwise, you'll see cryptic "dyld: Library not loaded: @rpath/GPUImage.framework/GPUImage" errors on execution).
但问题1的椰壳足目仍然无效.
But question 1 with cocoapods still not work.
推荐答案
这很不好,我得到了解决方案:
it's my bad, i got the solution:
然后,您需要添加一个新的复制文件"构建阶段,并设置目标" 到Frameworks,然后向其中添加GPUImage.framework构建产品. 这将使框架与您的应用程序捆绑在一起 (否则,您将看到神秘的"dyld:未加载库: @ rpath/GPUImage.framework/GPUImage"在执行时出错).
You then need to add a new Copy Files build phase, set the Destination to Frameworks, and add the GPUImage.framework build product to that. This will allow the framework to be bundled with your application (otherwise, you'll see cryptic "dyld: Library not loaded: @rpath/GPUImage.framework/GPUImage" errors on execution).
这篇关于Pod安装GPUImage不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!