10

I am working on a Swift project with cocoapods. Here is Podfile:

pod 'GPUImage', '~> 0.1.4'
  1. After i run pod install, i try got the error about import file:

    import GPUImage enter image description here

I uninstalled GPUImage from podfile, then try the second solution, i got different error.

  1. This link is the project instruction on github. My steps are:

    • Copy&Paste GPUImage.xcodeproj into project root directory, and added it into my project.

    • 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"}

Any help, thx!

EDIT:

The error right now is:

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

EDIT: For solution without using pods, here is solution:

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).

But question 1 with cocoapods still not work.

William Hu
  • 15,423
  • 11
  • 100
  • 121

3 Answers3

5

it's my bad, i got the solution:

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).

William Hu
  • 15,423
  • 11
  • 100
  • 121
  • For Pals still looking in 2021, please check the destination in Copy Files of Build phases, it should be framework as mentioned above( My destination was set to resources) – Vivek Oct 21 '21 at 06:55
  • can you pls add more details how to do that @Vivek – mefahimrahman Aug 07 '23 at 11:12
3

I had the same issue with the following library versions:

  • Xcode 6.3
  • Cocoapods 0.37.2

Finally I solved this issue by the following steps:

First step:

  1. Open Xcode
  2. Click Window (Menu Bar)
  3. Click Projects
  4. Remove all projects (e.g. use backspace)
  5. Close Xcode

Second Step:

  1. Open a terminal app
  2. cd ~/Library/Developer/Xcode/DerivedData
  3. rm -rf Build/* see below if you have a customized build location
  4. rm -rf ModuleCache/*
  5. Close a terminal app

Third Step:

  1. Open Xcode
  2. Product > Clean
  3. Product > Run

If you have defined a custom build location:

  1. 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
  2. Go to that location and delete the Build folder

Then everything work well.

Hope this can help somebody in the future.

skofgar
  • 1,607
  • 2
  • 19
  • 26
NSR
  • 819
  • 7
  • 20
  • This did it for me, including deleting all the files of the previously build projects: Go with Finder or the Terminal to the location of these files → `Open Xcode -> Settings -> Locations -> Derived Data` and delete everything – skofgar Jun 15 '15 at 01:12
  • I got clear failed by your answer step, my errors come after convert swift2 to swift3. – aircraft Oct 31 '16 at 07:40
0

In my case, just change Develop account in Signing & Capabilities then build app again. It works

nhathm
  • 343
  • 2
  • 5