I'm trying to build my react native project for Android but I get this error.
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:configureCMakeDebug[arm64-v8a]'.
> [CXX1409] [project folder]/android/app/.cxx/Debug/l1z3g258/arm64-v8a/android_gradle_build.json debug|arm64-v8a : expected buildFiles file '[project folder]/node_modules/react-native-screens/android/src/main/jni/CMakeLists.txt' to exist
* 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:
java.lang.StackOverflowError (no error message)
* 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.
I get the same CMakeLists.txt missing error in Android Studio -> Build as well.
The library in the error, react-native-screens
, was installed at one point but it is not something I'm using anymore. It is not part of my package.json file now. The only few references to this file that I can find in my project now is in the [project fodler]/android/app/.cxx/debug
& [project fodler]/android/app/wef/debug
folder. I'm not sure how to clean the reference here to not include libraries that are no longer installed in the project.
When I run ./gradlew clean
inside android folder I run into the same issue again.