Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoapods dyld: Library not loaded @rpath Image not found

I am currently using Xcode 8.1, cocoa pods 1.2.0.beta.1, and launching my app on a simulator with iOS 10.1. My app builds just fine, however after launching the app in a simulator, I receive the following error:

dyld: Library not loaded: @rpath/AFNetworking.framework/AFNetworking
  Referenced from:            /Users/XXXXX/Library/Developer/CoreSimulator/Devices/XXXXX/data/Containers/Bundle/Application/XXXXX/XXXXX.app/XXXXX
  Reason: image not found

My Podfile is:

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
platform :ios, '8.0'

target "XXXXX" do
    platform :ios, '8.0'
    use_frameworks!

    pod 'AFNetworking'
    ...

end

post_install do | installer |
    require 'fileutils'
    FileUtils.cp_r('Pods/Target Support Files/Pods-XXXXX/Pods-XXXXX-acknowledgements.plist', 'Pods-Acknowledgements.plist', :remove_desve_destination => true)
end

I have already tried de-integrating and re-installing my cocoa pods, changing the Pods-XXXXX.framework to optional, disabling Bitcode, and cleaning the workspace. None of those options (or any combination of them) has worked. Any help is much appreciated.

like image 603
jeremyms Avatar asked Nov 24 '16 16:11

jeremyms


People also ask

What is Use_frameworks?

use_frameworks! declares that you want to use dynamic frameworks, instead of static libraries. With Xcode 9.0 and CocoaPods 1.5. 0 released, you could use static libraries with swift if you do not use use_frameworks! . One problem with use_frameworks! is that all your framework in Pods/Products are frameworks.

Where is the library in xcode?

Use the keyboard shortcut shift-command-L (⇧⌘L) to open the library. This opens the snippet browser in the source editor or the object browser in Interface Builder. Use shift-command-M (⇧⌘M) to open the media library.


1 Answers

For those who find this issue in the future, it has been solved by cleaning the build folder by doing Option+Shift+Command+K. This solves the issue.

like image 67
jeremyms Avatar answered Sep 30 '22 08:09

jeremyms