4

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?

arik
  • 28,170
  • 36
  • 100
  • 156
tanmoy
  • 1,276
  • 1
  • 10
  • 28
  • 1
    Have you been able to sort this out? I'm running into a similar issue with `ld: Invalid value (Producer: 'LLVM13.0.0-rust-1.57.0-stable' Reader: 'LLVM APPLE_1_1300.0.29.30_0') for architecture arm64` – arik Jan 06 '22 at 11:25
  • I am also running into this problem when trying to archive an iOS app that links against a static library written in Rust. – schellsan Jan 07 '22 at 01:10
  • This feels like the same cause as discussed in this [question and answer pair](https://stackoverflow.com/a/63434546/558006). In this case, the solution would seem to be to get cargo to use the Apple Developer LLVM rather than the rust-provided LLVM, as described [here](https://stackoverflow.com/a/56399256/558006). I am going to dive into learning about how to specify the LLVM used by the rust compiler and see if I can expand this comment into an answer. – brotskydotcom Jan 08 '22 at 21:24

2 Answers2

2

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

brotskydotcom
  • 665
  • 7
  • 10
0

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
Code on the Rocks
  • 11,488
  • 3
  • 53
  • 61