我正在与cocoapods合作开发一个Swift项目.这是Podfile:
pod 'GPUImage', '~> 0.1.4'
Run Code Online (Sandbox Code Playgroud)
运行后pod install,我尝试得到导入文件的错误:
导入GPUImage

我从podfile中卸载了GPUImage,然后尝试第二个解决方案,我得到了不同的错误.
这个链接是github上的项目指令.我的步骤是:
将GPUImage.xcodeproj复制并粘贴到项目根目录中,并将其添加到我的项目中.
转到" 构建设置 " - >" 构建阶段 " - >" 目标依赖项 ",添加PUImageFramework,在Link Binary With Libraries部分,添加了GPUImage.framework.
但我得到一个错误:
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"}
Run Code Online (Sandbox Code Playgroud)
任何帮助,thx!
编辑:
现在的错误是:
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
Run Code Online (Sandbox Code Playgroud)
编辑:对于不使用pod的解决方案,这里是解决方案:
然后,您需要添加新的"复制文件"构建阶段,将"目标"设置为"框架",并将GPUImage.framework构建产品添加到该阶段.这将允许框架与您的应用程序捆绑在一起(否则,您将看到神秘的"dyld:未加载库:@ rpath/GPUImage.framework/GPUImage"执行时出错).
但问题1与cocoapods仍然无法正常工作.
这是我的错,我得到了解决方案:
然后,您需要添加一个新的“复制文件”构建阶段,将“目标”设置为“框架”,并向其中添加 GPUImage.framework 构建产品。这将允许框架与您的应用程序捆绑在一起(否则,您将在执行时看到神秘的“dyld:未加载库:@rpath/GPUImage.framework/GPUImage”错误)。
| 归档时间: |
|
| 查看次数: |
6369 次 |
| 最近记录: |