dyld: Library not loaded, app requires AFNetworkin

2020-08-11 09:54发布

问题:

I am running into this error and cannot solve it. I have tried cleaning and running again, deleting all pods and installing again. Any hints?

dyld: Library not loaded: @rpath/AFNetworking.framework/AFNetworking
  Referenced from: /private/var/mobile/Containers/Bundle/Application/72522B8C-7F27-41BD-A9E4-FDB2F63F1F5E/MyApp.app/MyApp
  Reason: Incompatible library version: MyApp requires version 2.0.0 or later, but AFNetworking provides version 1.0.0

回答1:

I had this problem and tried a solution I found here https://github.com/CocoaPods/CocoaPods/issues/3903 - do a "Clean Build Folder" (Product menu -> hold down alt key and Clean should now say Clean Build Folder) and I also did a pod install but I don't think that matters.

I guess deleting the derived data folder also fixes the issue.