Skip to content

Windows: Error: unable to open output file when enabling the new architecture #33528

Description

@ralppppy

Description

I've installed the new version 0.68 then enable the new architecture and try to run npx react-native run-android and it doesn't build. I believe that it is because the path has front and backlashes.

`BUILD FAILED in 3m 21s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Note: D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native-gradle-plugin\src\main\java\com\facebook\react\codegen\generator\SchemaJsonParser.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':ReactAndroid:buildNdkBuildDebug'.

Build command failed.
Error while executing process C:\Users\user\AppData\Local\Android\Sdk\ndk\21.4.7075529\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\src\main\jni\react\jni\Android.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-21 NDK_OUT=D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj NDK_LIBS_OUT=D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/lib NDK_APPLICATION_MK=D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid/src/main/jni/Application.mk THIRD_PARTY_NDK_DIR=D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\third-party-ndk REACT_COMMON_DIR=D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid/../ReactCommon REACT_GENERATED_SRC_DIR=D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build/generated/source REACT_SRC_DIR=D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid/src/main/java/com/facebook/react -j16 butter fabricjni fb folly_futures folly_json glog glog_init hermes-executor-debug hermes-executor-release jscexecutor jsi jsijniprofiler jsinspector logger mapbufferjni react_codegen_rncore react_config react_debug react_nativemodule_core react_render_animations react_render_attributedstring react_render_componentregistry react_render_core react_render_debug react_render_graphics react_render_imagemanager react_render_leakchecker react_render_mapbuffer react_render_mounting react_render_runtimescheduler react_render_scheduler react_render_telemetry react_render_templateprocessor react_render_textlayoutmanager react_render_uimanager react_utils reactnativeblob reactnativejni reactnativeutilsjni reactperfloggerjni rrc_image rrc_root rrc_text rrc_unimplementedview rrc_view runtimeexecutor turbomodulejsijni yoga}
[armeabi-v7a] Prebuilt : libc++_shared.so <= /sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/
[armeabi-v7a] Prebuilt : libfbjni.so <= D:/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/jni/first-party/fbjni/jni/armeabi-v7a/
[armeabi-v7a] Compile++ thumb: folly_json <= Assume.cpp
[armeabi-v7a] StaticLibrary : libcallinvoker.a
[armeabi-v7a] Compile++ thumb: folly_json <= ToAscii.cpp
[armeabi-v7a] SharedLibrary : libruntimeexecutor.so
[armeabi-v7a] Prebuilt : libhermes.so <= D:/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/build/third-party-ndk/hermes/jni/armeabi-v7a/
make: Nothing to be done for 'runtimeexecutor'.
[armeabi-v7a] Compile++ thumb: folly_json <= ScopeGuard.cpp
[armeabi-v7a] Prebuilt : libjsc.so <= D:/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/build/third-party-ndk/jsc/jni/armeabi-v7a/
[armeabi-v7a] Compile++ thumb: fabricjni <= OnLoad.cpp
[armeabi-v7a] Compile++ thumb: fabricjni <= AsyncEventBeatV2.cpp
[armeabi-v7a] Compile++ thumb: fabricjni <= ReactNativeConfigHolder.cpp
[armeabi-v7a] Compile++ thumb: fabricjni <= Binding.cpp
[armeabi-v7a] Compile++ thumb: fabricjni <= FabricMountingManager.cpp
[armeabi-v7a] Compile++ thumb: fabricjni <= SurfaceHandlerBinding.cpp
[armeabi-v7a] Compile++ thumb: fabricjni <= ComponentFactory.cpp
[armeabi-v7a] Compile++ thumb: fabricjni <= JBackgroundExecutor.cpp
[armeabi-v7a] Compile++ thumb: folly_json <= json_pointer.cpp
[armeabi-v7a] Compile++ thumb: glog <= signalhandler.cc
[armeabi-v7a] Compile++ thumb: glog <= symbolize.cc
[armeabi-v7a] Compile++ thumb: glog <= raw_logging.cc
[armeabi-v7a] Compile++ thumb: glog <= vlog_is_on.cc
[armeabi-v7a] Compile++ thumb: glog <= utilities.cc
[armeabi-v7a] Compile++ thumb: glog <= demangle.cc
[armeabi-v7a] Compile++ thumb: glog <= logging.cc

error: unable to open output file 'D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj/local/armeabi-v7a/objs-debug/fabricjni/D_/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/OnLoad.o': 'No such file or directory'
1 error generated.
make: *** [C:/Users/user/AppData/Local/Android/Sdk/ndk/21.4.7075529/build//../build/core/build-binary.mk:478: D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj/local/armeabi-v7a/objs-debug/fabricjni/D_/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/OnLoad.o] Error 1
make: *** Waiting for unfinished jobs....
error: unable to open output file 'D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj/local/armeabi-v7a/objs-debug/fabricjni/D_/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/AsyncEventBeatV2.o': 'No such file or directory'
1 error generated.
make: *** [C:/Users/user/AppData/Local/Android/Sdk/ndk/21.4.7075529/build//../build/core/build-binary.mk:478: D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj/local/armeabi-v7a/objs-debug/fabricjni/D_/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/AsyncEventBeatV2.o] Error 1
error: unable to open output file 'D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj/local/armeabi-v7a/objs-debug/fabricjni/D_/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/ReactNativeConfigHolder.o': 'No such file or directory'
1 error generated.
make: *** [C:/Users/user/AppData/Local/Android/Sdk/ndk/21.4.7075529/build//../build/core/build-binary.mk:478: D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj/local/armeabi-v7a/objs-debug/fabricjni/D_/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/ReactNativeConfigHolder.o] Error 1
error: unable to open output file 'D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj/local/armeabi-v7a/objs-debug/fabricjni/D_/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.o': 'No such file or directory'
1 error generated.
make: *** [C:/Users/user/AppData/Local/Android/Sdk/ndk/21.4.7075529/build//../build/core/build-binary.mk:478: D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj/local/armeabi-v7a/objs-debug/fabricjni/D_/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.o] Error 1
error: unable to open output file 'D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj/local/armeabi-v7a/objs-debug/fabricjni/D_/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/FabricMountingManager.o': 'No such file or directory'
1 error generated.
make: *** [C:/Users/user/AppData/Local/Android/Sdk/ndk/21.4.7075529/build//../build/core/build-binary.mk:478: D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj/local/armeabi-v7a/objs-debug/fabricjni/D_/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/FabricMountingManager.o] Error 1
error: unable to open output file 'D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj/local/armeabi-v7a/objs-debug/fabricjni/D_/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/SurfaceHandlerBinding.o': 'No such file or directory'
1 error generated.
make: *** [C:/Users/user/AppData/Local/Android/Sdk/ndk/21.4.7075529/build//../build/core/build-binary.mk:478: D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj/local/armeabi-v7a/objs-debug/fabricjni/D_/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/SurfaceHandlerBinding.o] Error 1
error: unable to open output file 'D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj/local/armeabi-v7a/objs-debug/fabricjni/D_/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/ComponentFactory.o': 'No such file or directory'
1 error generated.
make: *** [C:/Users/user/AppData/Local/Android/Sdk/ndk/21.4.7075529/build//../build/core/build-binary.mk:478: D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj/local/armeabi-v7a/objs-debug/fabricjni/D_/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/ComponentFactory.o] Error 1
error: unable to open output file 'D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj/local/armeabi-v7a/objs-debug/fabricjni/D_/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/JBackgroundExecutor.o': 'No such file or directory'
1 error generated.
make: *** [C:/Users/user/AppData/Local/Android/Sdk/ndk/21.4.7075529/build//../build/core/build-binary.mk:478: D:\PERSONAL\PROGRAMMING\REACTNATIVE\TestnewArc\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\363s2q4f/obj/local/armeabi-v7a/objs-debug/fabricjni/D_/PERSONAL/PROGRAMMING/REACTNATIVE/TestnewArc/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/JBackgroundExecutor.o] Error 1

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

Version

0.68

Output of npx react-native info

System:
OS: Windows 10 10.0.22000
CPU: (16) x64 AMD Ryzen 7 4800H with Radeon Graphics
Memory: 212.03 MB / 6.68 GB
Binaries:
Node: 14.17.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 7.19.1 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32
Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0, 32.1.0, 33.0.0, 33.0.0
System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
Android NDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Version 2021.1.0.0 AI-211.7628.21.2111.8193401
Visual Studio: Not Found
Languages:
Java: 17.0.2 - C:\Program Files\Common Files\Oracle\Java\javapath\javac.EXE
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.68.0 => 0.68.0
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  • In windows machine install fresh version of RN
  • Enable new architecture in gradle.properties. newArchEnabled=true
  • run npx react-native run-android

Snack, code example, screenshot, or link to a repository

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions