Axort
Axort

Reputation: 2024

Xcode - Created an iOS framework but can't use it in a project

I've created an iOS framework with this tutorial: http://www.raywenderlich.com/65964/create-a-framework-for-ios#comments

When I add it to a completely new project, I can import my public header and I can build it successfully. The problem comes when I try to create an instance of an object from the framework; when building it, fails with 40 errors:

All errors are displayed like this:

Apple Mach-O Linker Error "_OBJC_CLASS_$_AVPlayerItem < this is an example.

At the bottom it shows this message > Symbol(s) not found for architecture arm64

At first I thought the problem was that the framework I created wasn't supporting arm64. I executed the following line in Terminal to check which architectures were supported by my framework:

xcrun lipo -info MyFramework

The output is > Architectures in the fat file: MyFramework are: armv7 i385 x86_64 arm64

I'm using Xcode 6.4.

Thank you.

UPDATE: Here are some images of the error list:

first

enter image description here

enter image description here

Thanks!

Upvotes: 2

Views: 664

Answers (2)

Waruna
Waruna

Reputation: 162

Go to Build Phases in your Xcode settings. Select Target Dependencies. Add your framework Target (with Tests target). And Clean the project and delete your all derivedData and Run project. Very Easy.

Upvotes: 0

John Tracid
John Tracid

Reputation: 4046

I could be wrong but I think that in your MyFramework project you used several iOS frameworks like AVFoundation and also C++ standard library (libstdc++.6.dylib). In your fat library you don't have them. You need to add this dependencies manually to that project.

Another good tutorial about creating iOS Framework is iOS Framework Tutorial

Upvotes: 1

Related Questions