ARTICLE AD BOX
Asked today
Viewed 18 times
I created a React Native project using React Native 0.84.1.
When I run:
npx react-native run-android
the build fails with many C++ linker errors.
Environment:
React Native: 0.84.1
NDK version: 27.1.12297006
Android SDK: Installed
CMake: Installed
Error snippet:
error: undefined symbol: std::__ndk1::basic_string
error: undefined symbol: operator new
error: undefined symbol: __cxa_throw
It looks like a C++ linking issue related to NDK.
Is NDK 27 compatible with React Native 0.84?
What NDK version should be used?
1
Possible Reasons
Installed a new package Corrupted Gradle wrapper (gradlew)Fix 1: Reinstall the package
Uninstall and reinstall the package properly:
npm install <package-name> --saveFix 2: Clean and rebuild Android project
cd android && ./gradlew clean && ./gradlew installDebugNote:
installDebug already builds the APK, so assembleDebug is not required.Fix 3: Reset Gradle (if issues persist)
cd android && \ ./gradlew --stop && \ ./gradlew clean && \ rm -rf ~/.gradle/caches/ && \ rm -rf app/build && \ ./gradlew installDebugSummary
| Normal cleanup | ./gradlew clean |
| Random build errors | ./gradlew clean && ./gradlew installDebug |
| Dependency issues | rm -rf ~/.gradle/caches/ |
| Gradle stuck/hanging | ./gradlew --stop |
| Completely broken build | Full reset (commands above) |
Explore related questions
See similar questions with these tags.
