react-native: Getting ReactAndroid:configureNdkBuildDebug Error when NewArch is Enabled
New Version
0.68.1
Old Version
0.67.3
Build Target(s)
Android Debug
Output of react-native info
System: OS: Windows 10 10.0.19044 CPU: (4) x64 Intel® Core™ i7-2640M CPU @ 2.80GHz Memory: 447.12 MB / 3.88 GB Binaries: Node: 16.15.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.18 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.5.5 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: API Levels: 30, 31, 32 Build Tools: 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0, 33.0.0 Android NDK: 24.0.8215888 Windows SDK: Not Found IDEs: Android Studio: Not Found Visual Studio: Not Found Languages: Java: 11.0.15 - C:\Program Files\Eclipse Adoptium\jdk-11.0.15.10-hotspot\bin\javac.EXE npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.68.1 => 0.68.1 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found
Issue and Reproduction Steps
My Issue:
I’m facing an error when buidling my react-native project, to be precisely, it’s an ndk problem when NewArch is enabled, but when it’s disabled, build success.
Error Log:
`> Task :ReactAndroid:configureNdkBuildDebug[arm64-v8a] FAILED C/C++: C:\Users\Administrator\Documents\GitHub\MoonMeet-CrossPlatform\node_modules\react-native\ReactAndroid/…/ReactCommon/butter/Android.mk:28: *** Android NDK: Aborting. . Stop.
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ‘:ReactAndroid:configureNdkBuildDebug[arm64-v8a]’.
[CXX1405] error when building with ndkBuild using C:\Users\Administrator\Documents\GitHub\MoonMeet-CrossPlatform\node_modules\react-native\ReactAndroid\src\main\jni\react\jni\Android.mk: Build command failed. Error while executing process C:\Users\Administrator\AppData\Local\Android\Sdk\ndk\23.1.7779620\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\Administrator\Documents\GitHub\MoonMeet-CrossPlatform\node_modules\react-native\ReactAndroid\src\main\jni\react\jni\Android.mk APP_ABI=arm64-v8a NDK_ALL_ABIS=arm64-v8a NDK_DEBUG=1 APP_PLATFORM=android-21 NDK_LIBS_OUT=C:\Users\Administrator\Documents\GitHub\MoonMeet-CrossPlatform\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\2l523i4m/lib NDK_APPLICATION_MK=C:\Users\Administrator\Documents\GitHub\MoonMeet-CrossPlatform\node_modules\react-native\ReactAndroid/src/main/jni/Application.mk THIRD_PARTY_NDK_DIR=C:\Users\Administrator\Documents\GitHub\MoonMeet-CrossPlatform\node_modules\react-native\ReactAndroid\build\third-party-ndk REACT_COMMON_DIR=C:\Users\Administrator\Documents\GitHub\MoonMeet-CrossPlatform\node_modules\react-native\ReactAndroid/…/ReactCommon REACT_GENERATED_SRC_DIR=C:\Users\Administrator\Documents\GitHub\MoonMeet-CrossPlatform\node_modules\react-native\ReactAndroid\build/generated/source REACT_SRC_DIR=C:\Users\Administrator\Documents\GitHub\MoonMeet-CrossPlatform\node_modules\react-native\ReactAndroid/src/main/java/com/facebook/react -j4 NDK_OUT=C:\Users\Administrator\Documents\GitHub\MoonMeet-CrossPlatform.cxx NDK_APP_SHORT_COMMANDS=true APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n} Android NDK: WARNING: Ignoring unknown import directory: C:\Users\Administrator\Documents\GitHub\MoonMeet-CrossPlatform\node_modules\react-native\ReactAndroid\build/generated/source Android NDK: C:\Users\Administrator\Documents\GitHub\MoonMeet-CrossPlatform\node_modules\react-native\ReactAndroid/…/ReactCommon/butter/Android.mk: Cannot find module with tag ‘glog’ in import path Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ? Android NDK: The following directories were searched: Android NDK:
C:\Users\Administrator\Documents\GitHub\MoonMeet-CrossPlatform\node_modules\react-native\ReactAndroid/…/ReactCommon/butter/Android.mk:28: *** Android NDK: Aborting. . Stop.`
Attachments:
I’ve seen something like Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
i did define it but still the same error
I can provide another files if recommended, Thanks React-Native Team!
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 43 (15 by maintainers)
The fix should be a part of the
0.68.2
release, so follow the Github releases and let us know if you no longer see the issue on that version once it’s out 🙂Yesterday I was able to test #33707 and verify that is effectively fixing the issue, with NDK 21 + I needed a new release of
react-native-codegen
(which is something we’ll have to do on the release branch as well).Hey @CortexTN I’ve just tested 0.68.2 on a fresh project on Windows, and I can confirm it builds and works correctly.
The error you’re experiencing is most likely related to dirtly build folder. I would suggest you to clean up the project and try re-building
hello again, great news, new arch works on windows with fresh project, the problem is with my project, I’ll do some workaround to see what’s the bug on my project, Thanks all for your work
@fortmarek Hello, I have a same problem with 0.68.2. NDK version is 21.4.7075529
didn’t try it, i will try it later, I’ve been busy with some things outside, I’ll comment and close this issue when i can confirm it works
Thanks for getting back to us - the fix should be hopefully be merged soon 🙌 You can also try out the new
0.69.0-rc.0
where the approach has changed and the long paths should no longer be an issue.Hey @CortexTN 👋
You might try to check out these two PRs (https://github.com/facebook/react-native/pull/33682 and https://github.com/facebook/react-native/pull/33707) and patch your local React Native to see if that helps. Whenever those PRs are merged, we plan to release another patch release
0.68.2
.In the meantime, if you could also provide reproducible steps, that would be fabulous.
@mganandraj do you think this issue might be related to your PRs?
hey folks, I just realised that this is technically a duplicate of https://github.com/facebook/react-native/issues/33528. A few folks are also reporting there that 0.68.2 addresses the problem but only for fresh new apps. Let’s close this and have the conversation progress there as it seems that now the ball is in the hands of the library maintainers to add new arch support.
@CortexTN have you been able to confirm that
0.68.2
works for you?Yes with all respect to #33707 's owner, it doesn’t fix my problem, anyway i’m using
0.68.1
on this open source project MoonMeet if you want to test changes or see if i did something wrong etc…sure but not now, I’m outside doing some businesses, I’ll mention the build logs as soon i back home (i may stay 3 hours outside)