capture-vision-react-native-samples icon indicating copy to clipboard operation
capture-vision-react-native-samples copied to clipboard

Dynamsoft library not built for ARM64

Open DenysLopatynskyiB opened this issue 1 year ago • 6 comments

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

DenysLopatynskyiB avatar May 21 '24 01:05 DenysLopatynskyiB

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

Dynamsoft-Henry avatar May 23 '24 09:05 Dynamsoft-Henry

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?

DenysLopatynskyiB avatar May 28 '24 02:05 DenysLopatynskyiB

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.

Dynamsoft-Henry avatar May 30 '24 02:05 Dynamsoft-Henry

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.

DenysLopatynskyiB avatar May 30 '24 04:05 DenysLopatynskyiB

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.

Dynamsoft-Henry avatar May 30 '24 08:05 Dynamsoft-Henry

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

DenysLopatynskyiB avatar May 31 '24 00:05 DenysLopatynskyiB