skip to Main Content

I am using react native expo and trying to build project in android studio getting this error


FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • What went wrong:
    Execution failed for task ‘:expo-modules-core:buildCMakeDebug[arm64-v8a]’.

Build command failed.
Error while executing process C:UsersDELLAppDataLocalAndroidSdkcmake3.18.1binninja.exe with arguments {-C E:My projectReact-Native projectsCryptoWallet-DarkModeexpo-crypto-walletreact-native-vrypto-walletnode_modulesexpo-modules-coreandroid.cxxDebug6d6s4v4marm64-v8a expo-modules-core}
ninja: Entering directory `E:My projectReact-Native projectsCryptoWallet-DarkModeexpo-crypto-walletreact-native-vrypto-walletnode_modulesexpo-modules-coreandroid.cxxDebug6d6s4v4marm64-v8a’
[1/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/Exceptions.cpp.o
[2/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptRuntime.cpp.o
[3/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptValue.cpp.o
[4/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptObject.cpp.o
[5/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JNIFunctionBody.cpp.o
[6/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/CachedReferencesRegistry.cpp.o
[7/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JNIInjector.cpp.o
[8/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/ExpoModulesHostObject.cpp.o
[9/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JSIInteropModuleRegistry.cpp.o
[10/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptModuleObject.cpp.o
[11/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/MethodMetadata.cpp.o
[12/12] Linking CXX shared library ……..buildintermediatescxxDebug6d6s4v4mobjarm64-v8alibexpo-modules-core.so
FAILED: ../../../../build/intermediates/cxx/Debug/6d6s4v4m/obj/arm64-v8a/libexpo-modules-core.so
cmd.exe /C "cd . && C:UsersDELLAppDataLocalAndroidSdkndk21.4.7075529toolchainsllvmprebuiltwindows-x86_64binclang++.exe –target=aarch64-none-linux-android21 –gcc-toolchain=C:/Users/DELL/AppData/Local/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64 –sysroot=C:/Users/DELL/AppData/Local/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -O0 -fno-limit-debug-info -Wl,–exclude-libs,libgcc.a -Wl,–exclude-libs,libgcc_real.a -Wl,–exclude-libs,libatomic.a -static-libstdc++ -Wl,–build-id -Wl,–fatal-warnings -Wl,–no-undefined -Qunused-arguments -shared -Wl,-soname,libexpo-modules-core.so -o ……..buildintermediatescxxDebug6d6s4v4mobjarm64-v8alibexpo-modules-core.so CMakeFiles/expo-modules-core.dir/src/main/cpp/CachedReferencesRegistry.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/Exceptions.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/ExpoModulesHostObject.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/JNIFunctionBody.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/JNIInjector.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/JSIInteropModuleRegistry.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptModuleObject.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptObject.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptRuntime.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptValue.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/MethodMetadata.cpp.o -L"E:/My project/React-Native projects/CryptoWallet-DarkMode/expo-crypto-wallet/react-native-vrypto-wallet/node_modules/expo-modules-core/android/build/react-native-0.69.6-debug.aar/jni/arm64-v8a" -llog -lfbjni -ljsi -lreactnativejni -lfolly_runtime -lreact_nativemodule_core -landroid -latomic -lm && cd ."
C:/Users/DELL/AppData/Local/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/binld: cannot open output file ……..buildintermediatescxxDebug6d6s4v4mobjarm64-v8alibexpo-modules-core.so: No such file or directory
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

  • 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.
==============================================================================

2: Task failed with an exception.

  • What went wrong:
    Execution failed for task ‘:expo-modules-core:buildCMakeDebug[armeabi-v7a]’.

Build command failed.
Error while executing process C:UsersDELLAppDataLocalAndroidSdkcmake3.18.1binninja.exe with arguments {-C E:My projectReact-Native projectsCryptoWallet-DarkModeexpo-crypto-walletreact-native-vrypto-walletnode_modulesexpo-modules-coreandroid.cxxDebug6d6s4v4marmeabi-v7a expo-modules-core}
ninja: Entering directory `E:My projectReact-Native projectsCryptoWallet-DarkModeexpo-crypto-walletreact-native-vrypto-walletnode_modulesexpo-modules-coreandroid.cxxDebug6d6s4v4marmeabi-v7a’
[1/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/Exceptions.cpp.o
[2/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptValue.cpp.o
[3/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptObject.cpp.o
[4/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JNIFunctionBody.cpp.o
[5/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/CachedReferencesRegistry.cpp.o
[6/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JNIInjector.cpp.o
[7/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/ExpoModulesHostObject.cpp.o
[8/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JSIInteropModuleRegistry.cpp.o
[9/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptRuntime.cpp.o
[10/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptModuleObject.cpp.o
[11/12] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/MethodMetadata.cpp.o
[12/12] Linking CXX shared library ……..buildintermediatescxxDebug6d6s4v4mobjarmeabi-v7alibexpo-modules-core.so
FAILED: ../../../../build/intermediates/cxx/Debug/6d6s4v4m/obj/armeabi-v7a/libexpo-modules-core.so
cmd.exe /C "cd . && C:UsersDELLAppDataLocalAndroidSdkndk21.4.7075529toolchainsllvmprebuiltwindows-x86_64binclang++.exe –target=armv7-none-linux-androideabi21 –gcc-toolchain=C:/Users/DELL/AppData/Local/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64 –sysroot=C:/Users/DELL/AppData/Local/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -O0 -fno-limit-debug-info -Wl,–exclude-libs,libgcc.a -Wl,–exclude-libs,libgcc_real.a -Wl,–exclude-libs,libatomic.a -static-libstdc++ -Wl,–build-id -Wl,–fatal-warnings -Wl,–exclude-libs,libunwind.a -Wl,–no-undefined -Qunused-arguments -shared -Wl,-soname,libexpo-modules-core.so -o ……..buildintermediatescxxDebug6d6s4v4mobjarmeabi-v7alibexpo-modules-core.so CMakeFiles/expo-modules-core.dir/src/main/cpp/CachedReferencesRegistry.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/Exceptions.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/ExpoModulesHostObject.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/JNIFunctionBody.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/JNIInjector.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/JSIInteropModuleRegistry.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptModuleObject.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptObject.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptRuntime.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptValue.cpp.o CMakeFiles/expo-modules-core.dir/src/main/cpp/MethodMetadata.cpp.o -L"E:/My project/React-Native projects/CryptoWallet-DarkMode/expo-crypto-wallet/react-native-vrypto-wallet/node_modules/expo-modules-core/android/build/react-native-0.69.6-debug.aar/jni/armeabi-v7a" -llog -lfbjni -ljsi -lreactnativejni -lfolly_runtime -lreact_nativemodule_core -landroid -latomic -lm && cd ."
C:/Users/DELL/AppData/Local/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/binld: fatal error: ……..buildintermediatescxxDebug6d6s4v4mobjarmeabi-v7alibexpo-modules-core.so: open: No such file or directory
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

  • 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.
==============================================================================

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

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

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 14m 14s
482 actionable tasks: 403 executed, 79 up-to-date


enter image description here

2

Answers


  1. @swatantra-goswami I had the same issue as well! Deleting and re-installing node modules worked for me! Do try the same!

    Login or Signup to reply.
  2. I have faced the same issue, however after reinitializing react-native app with npx [email protected] init it worked properly with [email protected].

    I have used bare react-native (version 0.70.6) initialization. So, in order to add expo to an existing project see https://docs.expo.dev/bare/installing-expo-modules/

    Have you checked these directories where expo-modules-core.so must be?
    buildintermediatescxxDebug6d6s4v4mobjarmeabi-v7a
    buildintermediatescxxDebug6d6s4v4mobjarmeabi-v8a

    If expo-modules-core.so files exist in these folders and you use windows, then you probably have problem with win32 long paths. See https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry

    In order to enable long paths, you need to enable them on system (see link above) and attach executable manifest to ld executable (see How do I add a manifest to an executable using mt.exe?) which throws an error. In your case, you can see path to the ld executable in error log.

    For manifest file I have used this configuration from https://github.com/ninja-build/ninja/blob/master/windows/ninja.manifest :

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
      <application>
        <windowsSettings>
          <activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
          <longPathAware  xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
        </windowsSettings>
      </application>
    </assembly>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search