mohammadreza
mohammadreza

Reputation: 235

iOS objective c framework not working in simulator

I wrote the objective-c framework and build it with connect my iphone in Xcode, when add this framework to my project and run with iphone 8 simulator I got an error that for x86 architecture.

how can I fix this error?

P.S: I want to framework works with both device and simulator.

Upvotes: 1

Views: 1274

Answers (2)

Itachi
Itachi

Reputation: 6090

It's not about your app target, but TestFrameWork.framework.

Check the architecture of the TestFrameWork.framework with this command in terminal:

lipo -info /path/to/TestFrameWork.framework/TestFrameWork

It outputs the arch list there. If you could build your apps with this framework in the iOS real device, it must contain the armv7 armv7s arm64 inside, that's the iOS device's environment used.

For the iOS Simulator, it uses your nested macOS environment i386 x86_64. If you have the TestFrameWork.framework source code, compile it in both in iOS simulator and iOS device, use lipo command to merge them into a fat one. If you get the TestFrameWork.framework from your partners or vendors, send a request to them for this. Every iOS library developer shall know this, I think.

Good luck!

Upvotes: 2

arturdev
arturdev

Reputation: 11039

The reason is that your framework doesn't support i386 architecture.
You need no create a universal framework.

Check out this tutorial.

Upvotes: 1

Related Questions