question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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 <= <NDK>/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

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:7
  • Comments:44 (12 by maintainers)

github_iconTop GitHub Comments

9reactions
kelsetcommented, Apr 6, 2022

hey folks - just to give you a quick update, I’ve reported this internally at Microsoft and a couple of engineers have been looking into it. We think we have found the commit that “broke” this and we are looking into ways of fixing this, by end of the week we should have some options on the table - the aim is for this to be fixed in 0.68.1

4reactions
slacicommented, Mar 31, 2022

The same happens for me too. The same app builds on a Mac (for android ofc) without problems, but on Windows the buildNdkBuildDebug task fails with these No such file or directory errors.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to write to output file '<filename>': <error> - Visual Basic
In this article​​ There was a problem creating the file. An output file cannot be opened for writing. The file (or the folder...
Read more >
Error: unable to open output file 'build/src/main.o ... - VEX Forum
I'm pretty sure there are two things wrong here. First, the file or folder you're trying to save it to doesn't exist, and...
Read more >
How To Fix Extraction Failed Cannot Open Output File Error
cannot open output file latest version winrar ... in favor of fair use. how to enable safe mode:https://youtu.be/8Ii-lYF8nf8 windows update ...
Read more >
Blocks error 'ld.exe cannot open output file permission denied'
Go to your program files where the IDE is stored. On that file (say the code blocks) check properties and in security change...
Read more >
delphi - Fatal Error: Cannot create output file "project1.exe"
I found the solution. It appears that disabling the service "Application Experience" caused this. When disabled the task "system" will lock "any" executable ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found