0

I have 2 targets, my actual application and my Framework (that has some screens and logic inside of it)

enter image description here

As ive seen done in many tutorials, i'm initialising the framework screens by calling the first screen in the framework:

let frameworkBundle = Bundle(for: HomeViewController.self)
        let storyboard = UIStoryboard.init(name: "Main", bundle: frameworkBundle)
        window?.rootViewController = storyboard.instantiateInitialViewController()
        window?.makeKeyAndVisible()

Everything builds up fine, but before the actualy application can load up i get an error saying :

Library not loaded

Here is my Podfile:

target 'TriageFramework' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  pod 'PhoneNumberKit', '~> 2.5'
  pod 'Fabric'
  pod 'SwiftKeychainWrapper'
  pod 'Crashlytics'
  pod 'SVProgressHUD'

  target 'Virtual First' do
    inherit! :search_paths
  end


end

Here is the full error message:

dyld: Library not loaded: @rpath/PhoneNumberKit.framework/PhoneNumberKit
  Referenced from: /var/containers/Bundle/Application/9DC8D338-6DD7-4CCA-8FD5-804DD00FE015/Virtual First.app/Virtual First
  Reason: no suitable image found.  Did find:
    /private/var/containers/Bundle/Application/9DC8D338-6DD7-4CCA-8FD5-804DD00FE015/Virtual First.app/Frameworks/PhoneNumberKit.framework/PhoneNumberKit: mach-o, but wrong architecture
    /private/var/containers/Bundle/Application/9DC8D338-6DD7-4CCA-8FD5-804DD00FE015/Virtual First.app/Frameworks/PhoneNumberKit.framework/PhoneNumberKit: mach-o, but wrong architecture
    /private/var/containers/Bundle/Application/9DC8D338-6DD7-4CCA-8FD5-804DD00FE015/Virtual First.app/Frameworks/PhoneNumberKit.framework/PhoneNumberKit: mach-o, but wrong architecture

What am i doing wrong ?

Chief Madog
  • 1,738
  • 4
  • 28
  • 55
  • Have you look into https://stackoverflow.com/questions/24993752/os-x-framework-library-not-loaded-image-not-found ? – Sateesh Yemireddi Jan 23 '19 at 12:05
  • Possible duplicate of [OS X Framework Library not loaded: 'Image not found'](https://stackoverflow.com/questions/24993752/os-x-framework-library-not-loaded-image-not-found) – Sateesh Yemireddi Jan 23 '19 at 12:05
  • 1
    @Sateesh it's not, i looked into that first prior opening this question, and i have it just in the same settings as in the answer in that post, – Chief Madog Jan 23 '19 at 12:08

1 Answers1

1

Delete derive data and clean the project. Run now.

Daljeet
  • 1,573
  • 2
  • 20
  • 40