dart-archive/wasm

Android build fails on macOS

dnys1 opened this issue · 1 comments

dnys1 commented

Building an app with flutter_wasm currently fails on macOS for me. The gradle output is:

  running: "/Users/nydillon/Library/Android/sdk/ndk/21.1.6352462/toolchains/llvm/prebuilt/mac" "os" "x-x86_64/bin/aarch64-linux-android29-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-Wall" "-Wextra" "-DCFG_TARGET_OS_ANDROID" "-o" "/Users/nydillon/dev/AmplifyFlutter-DSTestApp/build/flutter_wasm/intermediates/stripped_native_libs/debug/out/lib/arm64-v8a/aarch64-linux-android/release/build/wasmer-vm-2eff8b72936265b4/out/src/trap/handlers.o" "-c" "src/trap/handlers.c"

  --- stderr

  error occurred: Failed to find tool. Is `mac` installed?

It seems that this line produces a string with spaces "mac os x", but regardless is not retrieving the correct value, given this listing of the directory it's searching.

$ ls /Users/nydillon/Library/Android/sdk/ndk/21.1.6352462/toolchains/llvm/prebuilt
darwin-x86_64

Manually changing that line of code to search the darwin-x86_64 directory fixes the issue.

I haven't been able to verify that #67 fixes this bug, because my mac seems to think the NDK isn't installed at all. But the fix seems straightforward enough.