'ld: Invalid value (Producer: 'LLVM13.0.0-rust-1.57.0-nightly' Reader: 'LLVM APPLE_1_1300.0.29.3_0') for architecture arm64

Trying to install and work with zkgroup. Build, run for specific iOS device working fine.

But generic archiving is not working.

Error text: ld: Invalid value (Producer: 'LLVM13.0.0-rust-1.57.0-nightly' Reader: 'LLVM APPLE_1_1300.0.29.3_0') for architecture arm64

Rust toolchain:

installed toolchains
--------------------

stable-x86_64-apple-darwin
nightly-2021-06-08-x86_64-apple-darwin
nightly-2021-09-16-x86_64-apple-darwin (default)
nightly-2021-09-19-x86_64-apple-darwin

installed targets for active toolchain
--------------------------------------

aarch64-apple-ios
aarch64-apple-ios-sim
x86_64-apple-darwin
x86_64-apple-ios

active toolchain
----------------

nightly-2021-09-16-x86_64-apple-darwin (default)
rustc 1.57.0-nightly (2c7bc5e33 2021-09-15)

Any insight?



Solution 1:[1]

The solution to this problem turns out to be deceptively simple: set the Xcode build setting "Enable Bitcode" to "No", as in this image: Xcode build settings (I figured this out by first discovering that command-line archive builds did not have this problem, and then comparing their log with the in-Xcode build log. The in-XCode build was doing bitcode-verify operations, which reminded me that the Rust cargo-lipo README talks about turning this setting off to avoid this LLVM incompatibility.)

Solution 2:[2]

I was fighting with this error while using the isar package in Flutter. The problem was with isar_flutter_libs 2.5.0.

Solution

  1. Delete pubspec.lock and podfile.lock
  2. Downgrade all isar libs to 2.4.0
  3. In the terminal, run dart pub remove isar_flutter_libs
  4. flutter pub get
  5. pod update

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 brotskydotcom
Solution 2 Joe Muller