depoon / NetworkInterceptor

iOS URLRequest interception framework
MIT License
157 stars 35 forks source link

dyld: Library not loaded error in example project #25

Closed bryankeller closed 4 years ago

bryankeller commented 4 years ago

Environment: Xcode 10.2.1, iPhone 6s running iOS 11.1

  1. Clone repo
  2. Run pod install
  3. Open workspace
  4. Change Deployment Target to 11.1 for the NetworkInterceptorExample target
  5. Set development team for the NetworkInterceptorExample target
  6. Add NetworkInterceptor.framework to Embedded Binaries and Linked Frameworks and Libraries for the NetworkInterceptorExample target
  7. Build app to iPhone 6s

Crash:

dyld: Library not loaded: @rpath/Gzip.framework/Gzip
  Referenced from: /private/var/containers/Bundle/Application/A389EC6B-C473-40A9-A640-DE766113F417/NetworkInterceptorExample.app/Frameworks/NetworkInterceptor.framework/NetworkInterceptor
  Reason: image not found
bryankeller commented 4 years ago

Just discovered a fix here after struggling with this for several hours:

On the NetworkInterceptor target, you must manually add Gzip.framework and URLRequest_cURL.framework as optional, like this:

Screen Shot 2019-07-23 at 9 59 25 PM