Incompatible architecture (have 'arm64', need 'x86_64') in M1 mac
[mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64') in Flutter]

change arch env /usr/bin/arch -arm64 /bin/zsh env /usr/bin/arch -x86_64 /bin/zsh clean and build
@Sean-Snow.. changing the arch didn't solve the issue...
Same Issue when I want to call "keyToDID" method with android on Macbook M1 pro:
error: Invalid argument(s): Failed to load dynamic library 'libdidkit.so': dlopen failed: library "libdidkit.so" not found, stack: #0 _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:12:43)
I/flutter ( 5031): #1 new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:23:12)
I/flutter ( 5031): #2 lib (package:didkit/didkit.dart:9:22)
I/flutter ( 5031): #3 lib (package:didkit/didkit.dart)
I/flutter ( 5031): #4 key_to_did (package:didkit/didkit.dart:29:20)
I/flutter ( 5031): #5 key_to_did (package:didkit/didkit.dart)
I/flutter ( 5031): #6 DIDKit.keyToDID (package:didkit/didkit.dart:119:17)
Could you both specify what Flutter commands you are running and for which targets?
@bibash28 you will need to compile DIDKit for x86
rustup target add x86_64-apple-darwin
cargo build --release --target x86_64-apple-darwin
Then, assuming you're in the flutter directory, you need to set DYLD_LIBRARY_PATH="$PWD/../../target" and things should work. Except if you're running flutter test in which case you'll need to hardcode the path.
@TalebRafiepour you should follow the steps above but with the correct target, e.g. x86_64-linux-android.
@sbihel I am trying to build for android in M1 mac... Let me share the commands
echo "Checking for rustup installation and setting rust to nightly."
if ! command -v rustup &>/dev/null; then
echo "rustup"
if ! command -v curl &>/dev/null; then
echo "curl"
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "rust darwin"
brew install curl
else
echo "rust linux"
sudo apt install curl -yet
fi
fi
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
fi
rustup default nightly
echo "Cloning DIDKit repo if not yet on previous directory"
[ ! -d "didkit" ] && git clone https://github.com/spruceid/didkit.git
cd didkit
if [[ "$*" == *-android* ]]; then
echo "Build didkit for Android"
cd lib/flutter
fvm use 2.10.1
fvm flutter pub get
cd -
make -C lib install-rustup-android
make -C lib ../target/test/java.stamp
make -C lib ../target/test/android.stamp
make -C lib ../target/test/flutter.stamp
fi
cargo build
Ref: https://github.com/spruceid/credible/blob/main/install_android_dependencies.sh
You can drop make -C lib ../target/test/flutter.stamp in that script
ok. @sbihel
make -C lib ../target/test/flutter.stamp
is failing...
error: Invalid argument(s): Failed to load dynamic library 'libdidkit.so': dlopen failed: library "libdidkit.so" not found, stack: #0 _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:12:43)
I/flutter ( 5031): #1 new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:23:12)
I/flutter ( 5031): #2 lib (package:didkit/didkit.dart:9:22)
I/flutter ( 5031): #3 lib (package:didkit/didkit.dart)
I/flutter ( 5031): #4 key_to_did (package:didkit/didkit.dart:29:20)
I/flutter ( 5031): #5 key_to_did (package:didkit/didkit.dart)
I/flutter ( 5031): #6 DIDKit.keyToDID (package:didkit/didkit.dart:119:17)
Android app returns this error..
I meant, you can remove it.
removing doesn't solve issue @sbihel
Is it the same error? For which command?
I still have this issue @sbihel @itsbalamurali
What I did? I followed https://github.com/spruceid/didkit/pull/315/commits/8cb30fd28069a97e9f5679c77a2f3c6d567e3e06 https://github.com/spruceid/didkit/pull/315/commits/c381070a97f8bd98c853bfed4e3220e08a5e78bc
I'm encountering the same issue when building an iOS framework. Do someone fix this problem or find the solution?
Not yet @kangminhao