Dynamsoft / capture-vision-react-native-samples

Dynamsoft Capture Vision React-Native SDK Samples
https://www.dynamsoft.com/capture-vision/docs/introduction/
Other
15 stars 7 forks source link

Dynamsoft library not built for ARM64 #46

Open DenysLopatynskyiB opened 6 months ago

DenysLopatynskyiB commented 6 months ago

Good day,

when building on Apple M Chips without any special flags (Ie setting architecture to x86_64) or enabling rosetta, the yarn iOS command fails due to this error:

building for iOS Simulator, but linking in dylib built for iOS, file '/Users/dlopatynskyi/Documents/GitHub/buni-powerpass-app/ios/Pods/DynamsoftBarcodeReader/DynamsoftBarcodeReader.framework/DynamsoftBarcodeReader' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

My understanding is that it is because it is not built for ARM64 architecture.

Can you please have a look?

thank you in advance.

Regards,

Denys

Dynamsoft-Henry commented 6 months ago

Hi @DenysLopatynskyiB

Option 1: In the workspace Go to target->Build Settings and exclude the Arm64 architecture.

rn-exclude-architecture

Option 2: Exclude Arm64 via the podfile:

post_install do |installer| installer.pods_project.build_configurations.each do |config| config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" end end

DenysLopatynskyiB commented 6 months ago

Thank you for the workarounds, but your library is the only one that requires this.

I would prefer if we could keep our Podfile and Project settings "clean" or "out of the box".

Is there much required to build your Lib for arm 64?

Dynamsoft-Henry commented 6 months ago

Hi @DenysLopatynskyiB

This library only supports ARM64 (iPhone), x86_64 (Simulator). ARM64 (Simulator) is not supported. That's why it requires this workaround.

This library is not supposed to be run on a simulator because it requires a camera.

DenysLopatynskyiB commented 6 months ago

Hi @DenysLopatynskyiB

This library only supports ARM64 (iPhone), x86_64 (Simulator). ARM64 (Simulator) is not supported. That's why it requires this workaround.

This library is not supposed to be run on a simulator because it requires a camera.

Hi @Dynamsoft-Henry , I agree with you, that it doesn't need to work/be supported in the Simulator, BUT, it shouldn't be breaking builds.

Dynamsoft-Henry commented 6 months ago

Hi @DenysLopatynskyiB It is a historical issue of this library. The 1.x versions of this library were compiled from .framework which can't exclude the unsupported architectures automatically.

We are developing a 2.x version (based on the .xcframeworks). The new version will no longer ask you to exclude the architectures manually. The new version will be released in a few months.

DenysLopatynskyiB commented 6 months ago

That sounds great. Will wait for the 2.x version to be released then.

Thank you for your help.

Regards,

Denys

P.S. you can close the issue if you like