Dev Center
Swift
Objective-C
Table of contents

How to resolve the “Building for iOS Simulator, but linking in dylib built for iOS” error when building for the iOS simulator?

« Back to FAQ index

DBR iOS can be used to build apps that belong to the arm64 architecture. If you try building an app for the arm64 simulator, and you migrated your app from an older version of Xcode to Xcode 12 or higher, then you might encounter the following error message:

ld: “Building for iOS Simulator, but linking in dylib built for iOS, file ‘/ios/Pods/DynamsoftBarcodeReader/DynamsoftBarcodeReader.framework/DynamsoftBarcodeReader’ for architecture arm64”


In order to fix the error, please take the following steps under the Build Settings of the Xcode project:

  1. Under User-Defined -> find VALIDATE_WORKSPACE and set it to YES. Rebuild your project.

  2. Under Architectures -> find Build Active Architecture Only and set it to YES.

  3. Under Architectures -> make sure that Architectures is set to $(ARCHS_STANDARD).


If the error message persists, please make one of the following changes:

  • Instead of using the .framework (which all the samples do by default), switch to using the corresponding .xcframework

  • Under the Build Settings -> find Excluded Architectures -> in the Debug field click the + icon -> select Any iOS Simulator SDK -> put “arm64”

  • You can also exclude architectures via the Podfile as such:

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

    OR

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

    OR

      podspec:
      s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
      s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
    

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest version
    • Version 10.x
      • Version 10.2.10
      • Version 10.0.21
      • Version 10.0.20
      • Version 10.2.10
      • Version 10.0.21
      • Version 10.0.20
    • Version 9.x
      • Version 9.6.40
      • Version 9.6.20
      • Version 9.6.11
      • Version 9.6.10
      • Version 9.6.0
      • Version 9.4.0
      • Version 9.2.11
      • Version 9.2.10
      • Version 9.0.2
      • Version 9.0.1
      • Version 9.0.0
      • Version 9.6.40
      • Version 9.6.20
      • Version 9.6.10
      • Version 9.6.0
      • Version 9.4.0
      • Version 9.2.13
      • Version 9.2.10
      • Version 9.0.2
      • Version 9.0.1
      • Version 9.0.0
    • Version 8.x
      • Version 8.9.3
      • Version 8.9.1
      • Version 8.9.0
      • Version 8.8.0
      • Version 8.6.0
      • Version 8.4.0
      • Version 8.2.1
      • Version 8.2.0
      • Version 8.1.2
      • Version 8.1.0
      • Version 8.0.0
      • Version 8.9.3
      • Version 8.9.1
      • Version 8.9.0
      • Version 8.8.0
      • Version 8.6.0
      • Version 8.4.0
      • Version 8.2.1
      • Version 8.2.0
      • Version 8.1.2
      • Version 8.1.0
      • Version 8.0.0
    • Version 7.x
      • Version 7.6.0
      • Version 7.5.0
      • Version 7.6.0
      • Version 7.5.0
    Change +