cawfree / react-native-webassembly

⚛️ 🏎 WebAssembly for React Native powered by JSI.
https://twitter.com/cawfree
MIT License
291 stars 6 forks source link

Android build fails on React Native 0.73.2 #26

Open jesse-savary opened 7 months ago

jesse-savary commented 7 months ago

Crash log:

> Task :react-native-webassembly:buildCMakeDebug[armeabi-v7a] FAILED

FAILURE: Build failed with an exception.

* What went wrong:
  Execution failed for task ':react-native-webassembly:buildCMakeDebug[armeabi-v7a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/.../node_modules/react-native-webassembly/android/.cxx/Debug/5i3r5q68/armeabi-v7a'
[1/18] Building C object CMakeFiles/cpp.dir/.../node_modules/react-native-webassembly/cpp/m3_api_meta_wasi.c.o
...
[14/18] Building C object CMakeFiles/cpp.dir/.../node_modules/react-native-webassembly/cpp/m3_env.c.o
FAILED: CMakeFiles/cpp.dir/.../node_modules/react-native-webassembly/cpp/m3_env.c.o
.../Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang ...
fatal error: error in backend: failed to perform tail call elimination on a call site marked musttail
PLEASE submit a bug report to https://github.com/android-ndk/ndk/issues and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
...
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Android (8490178, based on r450784d) clang version 14.0.6 (https://android.googlesource.com/toolchain/llvm-project 4c603efb0cca074e9238af8b4106c30add4418f6)
Target: armv7-none-linux-android23
Thread model: posix
InstalledDir: .../Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/bin
clang: note: diagnostic msg:
  ********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/.../m3_env-e8551f.c
clang: note: diagnostic msg: /var/folders/.../m3_env-e8551f.sh
clang: note: diagnostic msg: Crash backtrace is located in
clang: note: diagnostic msg: .../Library/Logs/DiagnosticReports/clang_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
clang: note: diagnostic msg:

  ********************
...
ninja: build stopped: subcommand failed.

C++ build system [build] failed while executing:
.../Library/Android/sdk/cmake/3.22.1/bin/ninja \
-C \
.../node_modules/react-native-webassembly/android/.cxx/Debug/5i3r5q68/armeabi-v7a \
cpp
from .../node_modules/react-native-webassembly/android

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 7m 37s

Additional files: m3_compile-1231f9.c.txt m3_compile-1231f9.sh.txt (no .crash file)

anudit commented 5 months ago

Running into the same error with Expo 50

rhenandias commented 4 months ago

Same here, with version "expo": "~50.0.14".

I'm not trying to use Expo Go, even after prebuild the npx expo run:android fails to build.

My gradle.properties has the property newArchEnabled=true and I'm using the following code to verify if the new architecture is loaded:

const uiManager = global["nativeFabricUIManager" as keyof typeof globalThis]
  ? "Fabric"
  : "Paper";

console.log(`Using ${uiManager}`);

Before installing the package react-native-webassembly, with this code, the console shows that it is using Fabric, with the nativeFabricUIManager. However, the Metro itself don't shows the Fabric log by default as mentioned in this answer. To enable the new architecture, I followed the steps outlined in this part of the documentation.

Am I missing something?