blinkid-ios icon indicating copy to clipboard operation
blinkid-ios copied to clipboard

building for iOS Simulator, but linking in dylib built for iOS

Open kolindalanaresh opened this issue 4 years ago • 18 comments

Hi, My project is working fine in Xcode 11 version while running in Xcode 12 beta 4 getting like below. ld: building for iOS Simulator, but linking in dylib built for iOS, file '/Projectfolder/Pods/PPBlinkID/Microblink.framework/Microblink' for architecture arm64. Kindly help me on this

Thanks in Advance

kolindalanaresh avatar Aug 17 '20 16:08 kolindalanaresh

Hello @kolindalanaresh

Apologies for the delay in our response.

The reason this is happening is because, at the moment, we currently do not support Xcode 12 with our SDKs.

However, from version 5.8, we plan to add support for version 12.

Hope this helps.

Regards, Milan

mparadina avatar Aug 31 '20 12:08 mparadina

Hi @kolindalanaresh

Just to follow-up on my previous response.

Did you try implementing the Microblink.xcframework file into your project and seeing if the issue has been resolved?

Regards, Milan

mparadina avatar Aug 31 '20 13:08 mparadina

Hi @mparadina currently we have installed using pods.

kolindalanaresh avatar Sep 02 '20 07:09 kolindalanaresh

@mparadina when 5.8 will be released? Currently it blocks our release with fixes for iOS 14 so it is a bit urgent.

UPDATE: found solution on our side.

vg-identance avatar Sep 17 '20 14:09 vg-identance

Hi @vg-identance

Thank you for the feedback.

Would you mind sharing the solution with us?

Regards, Milan

mparadina avatar Sep 18 '20 11:09 mparadina

@mparadina it is complex issue for us because we implementing fat library and Microblink is a dependency of our lib and host app. To resolve issue on host app we add post_install hook described here and added EXCLUDED_ARCHS=arm64 during xcodebuild of simulator part of fat library.

vg-identance avatar Sep 18 '20 11:09 vg-identance

Hi @vg-identance and @kolindalanaresh

Just to follow-up on this thread.

We've released BlinkID 5.8 that is compatible with Xcode version 12.

If possible, could you try to run your projects with version 5.8 and see if the issue has been resolved?

Also, feel free to ask in case of any additional inquiries come up.

Regards, Milan

mparadina avatar Oct 07 '20 09:10 mparadina

@mparadina Just tested and can tell that issue still exists. I think you need to do 2 things to resolve it:

  • add arm64 to valid arhs (or remove EXCLUDED_ARCHS=arm64, depending on project settings) during simulator build for xcframework, because arm64 is absent for simulator arhs in xcframework
  • update s.ios.vendored_frameworks = 'Microblink.xcframework' in PPBlinkID.podspec file

vg-identance avatar Oct 28 '20 18:10 vg-identance

Hi @vg-identance

So you're saying that the issue is fixed for you, but then you're also suggesting that we change some things?

VALID_ARCHS is no longer used in Xcode 12. So when building for simulator, if "Build Active Architecture Only" is set to NO (typical for release configuration), we had to ensure that only compatible architectures are considered. We did that by setting ARCHS[sdk=iphonesimulator*] to "x86_64". Another option was to have something like ARCHS[sdk=iphonesimulator*]= "STANDARD_ARCHS" and EXCLUDED_ARCHS[sdk=iphonesimulator*]="arm64".

Regards, Mijo

mijo-gracanin avatar Oct 29 '20 15:10 mijo-gracanin

Hi @mijo-gracanin No, issue still exists. It was my typo there, sorry.

Ok I understand now how you removed arm64 from simulator build, but I don't understand why you did that for xcframework. Do you have any issues with it? To make proper build of our xcframework microblink also must be xcframework with arm64 included for simulator variant.

vg-identance avatar Oct 29 '20 16:10 vg-identance

@vg-identance To my knowledge, we don't have issues with xcframework. You obtained the SDK via cocoapods? do you have ios-i386_x86_64-simulator folder inside your Microblink.xcframework? Also, can you check the output of file Microblink.xcframework/ios-i386_x86_64-simulator/Microblink.framework/Microblink?

It should contain x86-64 arch.

mijo-gracanin avatar Oct 29 '20 16:10 mijo-gracanin

@mijo-gracanin yes using cocoapods but in podspec no xcframework: s.ios.vendored_frameworks = 'Microblink.framework' Anyway arm64 is absent in xcframework which exists in repo sources. Folder you showed must be named ios-arm64_i386_x86_64-simulator and include arm64 architecture.

vg-identance avatar Oct 29 '20 16:10 vg-identance

@vg-identance ok, we'll fix the podspec to have xcframework.

I still don't understand why would you need arm64 for simulator build? Simulator runs on a mac, which (still) has an x86-64 CPU, so it can not run arm64 build. xcframework should include 2 folders:

  • ios-arm64_armv7 for iOS device
  • ios-i386_x86_64-simulator for iOS simulator (until apple publishes a mac with ARM CPU)

Would it be possible for you to send us a sample project which demonstrates the issue ([email protected])?

Thanks, Mijo

mijo-gracanin avatar Oct 29 '20 16:10 mijo-gracanin

@mijo-gracanin

why would you need arm64 for simulator build

Because we can support this now. No need to wait until ARM CPU will be released. Btw where did you set ARCHS[sdk=iphonesimulator] to "x86_64"*? In xcode build settings or during xcodebuild before lipo for .framework? In our case we have two separate process for .framework and .xcframework. For .framework we do similar step with EXCLUDED_ARCHS[sdk=iphonesimulator*]="arm64". But for .xcframework that is not needed and our build is fully ready for future ARM CPU (except problem with microblink).

vg-identance avatar Oct 29 '20 16:10 vg-identance

@vg-identance I agree that it would be nice to make the SDK future-proof. We'll see what can be done about it.

We generate Xcode project with cmake and the full statement looks like this: set( CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "x86_64" )

mijo-gracanin avatar Oct 29 '20 19:10 mijo-gracanin

@mijo-gracanin Ok thanks. Will wait updates about it.

vg-identance avatar Oct 30 '20 09:10 vg-identance

@mijo-gracanin is this is fixed because after updating to 5.8.0 then also it is not working. Can you please help us ASAP.

kolindalanaresh avatar Jan 18 '21 09:01 kolindalanaresh

@kolindalanaresh the fix is scheduled for 5.11.0 release. which should be out in March or April.

mijo-gracanin avatar Jan 18 '21 10:01 mijo-gracanin