Pod 安装 GPUImage 不起作用
Pod install GPUImage does not work
我正在使用 cocoapods 进行 Swift 项目。这是 Podfile:
pod 'GPUImage', '~> 0.1.4'
在我运行pod install
之后,我尝试得到关于导入文件的错误:
导入GPUImage
我从 podfile 中卸载了 GPUImage,然后尝试第二种解决方案,我得到了不同的错误。
这个link是github上的项目说明。我的步骤是:
复制粘贴GPUImage.xcodeproj到项目根目录,然后添加到我的项目中
转到“构建设置”->“构建阶段”->“ Target Dependencies”,添加 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"}
任何帮助,谢谢!
编辑:
现在的错误是:
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
编辑:
对于不使用 pods 的解决方案,这里是解决方案:
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).
但是关于 cocoa 的问题 1pods 还是不行。
是我的错,我找到了解决方案:
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).
我对以下库版本有同样的问题:
- Xcode6.3
- 椰足类 0.37.2
最后我通过以下步骤解决了这个问题:
第一步:
- 打开Xcode
- 单击 Window(菜单栏)
- 单击项目
- 删除所有项目(例如使用退格键)
- 关闭Xcode
第二步:
- 打开终端应用程序
cd ~/Library/Developer/Xcode/DerivedData
rm -rf Build/*
如果您有自定义构建位置,请参阅下文
rm -rf ModuleCache/*
- 关闭终端应用程序
第三步:
- 打开Xcode
- 产品 > 清洁
- 产品 > 运行
If you have defined a custom build location:
- Go with Finder or the Terminal to the location of the build files. The location for these files is defined in Xcode. To check where these files are:
- Open Xcode
- Go to
Settings -> Locations -> Derived Data
- Go to that location and delete the
Build
folder
然后一切正常。
希望这对以后的人有所帮助。
在我的例子中,只需在 Signing & Capabilities 中更改 Develop account,然后重新构建应用程序。有效
我正在使用 cocoapods 进行 Swift 项目。这是 Podfile:
pod 'GPUImage', '~> 0.1.4'
在我运行
pod install
之后,我尝试得到关于导入文件的错误:导入GPUImage
我从 podfile 中卸载了 GPUImage,然后尝试第二种解决方案,我得到了不同的错误。
这个link是github上的项目说明。我的步骤是:
复制粘贴GPUImage.xcodeproj到项目根目录,然后添加到我的项目中
转到“构建设置”->“构建阶段”->“ Target Dependencies”,添加 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"}
任何帮助,谢谢!
编辑:
现在的错误是:
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
编辑: 对于不使用 pods 的解决方案,这里是解决方案:
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).
但是关于 cocoa 的问题 1pods 还是不行。
是我的错,我找到了解决方案:
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).
我对以下库版本有同样的问题:
- Xcode6.3
- 椰足类 0.37.2
最后我通过以下步骤解决了这个问题:
第一步:
- 打开Xcode
- 单击 Window(菜单栏)
- 单击项目
- 删除所有项目(例如使用退格键)
- 关闭Xcode
第二步:
- 打开终端应用程序
cd ~/Library/Developer/Xcode/DerivedData
rm -rf Build/*
如果您有自定义构建位置,请参阅下文rm -rf ModuleCache/*
- 关闭终端应用程序
第三步:
- 打开Xcode
- 产品 > 清洁
- 产品 > 运行
If you have defined a custom build location:
- Go with Finder or the Terminal to the location of the build files. The location for these files is defined in Xcode. To check where these files are:
- Open Xcode
- Go to
Settings -> Locations -> Derived Data
- Go to that location and delete the
Build
folder
然后一切正常。
希望这对以后的人有所帮助。
在我的例子中,只需在 Signing & Capabilities 中更改 Develop account,然后重新构建应用程序。有效