0

I'm creating a new Cocoa Touch Framework (MyFramework.framework), which will have a dependency on Alamofire. This framework will be written in Swift. As a test I started a new Cocoa Touch Framework project:

File > New > Project > Framework & Library > Cocoa Touch Framework

Then, in the terminal I performed:

pod init

under this projects directory. In the newly created Podfile I added the following:

// Uncomment this line to define a global platform for your project

platform :ios, '9.0'

// Uncomment this line if you're using Swift

use_frameworks!

pod 'Alamofire'

Once again, in the Terminal I performed:

pod install

and started coding away.

Everything seemed well and good till I used the MyFramework.framework Product in a Single View Project. When I attempt to run the project I get the following issue:

dyld: Library not loaded: @rpath/testfm.framework/MyFramework
  Referenced from: /var/containers/Bundle/Application/D4456F6A-2EBB-4AF9-B974-37A66E42D374/test.app/test

Reason: image not found

please let me know if you need more information.

Uma Madhavi
  • 4,851
  • 5
  • 38
  • 73
Vandana pansuria
  • 764
  • 6
  • 14

3 Answers3

3

Try to Embed MyFramework.framework into Build phase -> Embed Framework. like @Vishnu suggested.

Mohit Mangla
  • 337
  • 1
  • 15
0

Following Steps May be Help.

  • Delete the current .xcworkspace File
  • Open the .xcodeproj Just remove the pod from the project
  • Delete the current Pod file From the project and Clean the Project
  • Now go to file File -> New -> File -> Select the Empty File. save File with Podfile name. (Must save the Project in main Directory).
  • Open the Terminal and Drag and drop Podfileand install the pod again.
  • now close the .xcodeprojand open the .xcworkspace file.

Hope this Works.

Krunal Nagvadia
  • 1,083
  • 2
  • 12
  • 33
0

Hope you must have found the answer by now. For anyone else, make sure your custom framework setting is configured to "Embed & Sign" (As in image attached)

Then run your app.

enter image description here

Hyder
  • 1,163
  • 2
  • 13
  • 37