Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kolindalanaresh opened this issue Aug 17, 2020 · 18 comments
Open

Comments

@kolindalanaresh
Copy link

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

@mparadina
Copy link
Contributor

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
Copy link
Contributor

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

@kolindalanaresh
Copy link
Author

Hi @mparadina currently we have installed using pods.

@vg-identance
Copy link

vg-identance commented Sep 17, 2020

@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.

@mparadina
Copy link
Contributor

Hi @vg-identance

Thank you for the feedback.

Would you mind sharing the solution with us?

Regards,
Milan

@vg-identance
Copy link

@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.

@mparadina
Copy link
Contributor

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

@vg-identance
Copy link

vg-identance commented Oct 28, 2020

@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

@mijo-gracanin
Copy link
Contributor

mijo-gracanin commented Oct 29, 2020

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

@vg-identance
Copy link

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.

@mijo-gracanin
Copy link
Contributor

@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.

@vg-identance
Copy link

@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.

@mijo-gracanin
Copy link
Contributor

mijo-gracanin commented Oct 29, 2020

@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

@vg-identance
Copy link

@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).

@mijo-gracanin
Copy link
Contributor

@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" )

@vg-identance
Copy link

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

@kolindalanaresh
Copy link
Author

kolindalanaresh commented Jan 18, 2021

@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.

@mijo-gracanin
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants