Reputation: 63
The app was working fine yesterday, but now it gives me this error :
Execution failed for task ':app:configureCMakeDebug[arm64-v8a]'.
> [CXX1429] error when building with cmake using C:\{my path}\node_modules\react-native\ReactAndroid\cmake-utils\default-app-setup\CMakeLists.txt: -- The C compiler identification is Clang 14.0.6
-- The CXX compiler identification is Clang 14.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/{my path}/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/{my path}/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring incomplete, errors occurred!
See also "C:/{my path}/android/app/.cxx/Debug/5o3yy2s5/arm64-v8a/CMakeFiles/CMakeOutput.log".
......
CMake Error at C:{my path}/app/build/generated/rncli/src/main/jni/Android-rncli.cmake:6 (add_subdirectory):
add_subdirectory called with incorrect number of arguments
Call Stack (most recent call first):
C:{my path}/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:123 (include)
CMakeLists.txt:31 (include)
CMake Error at C:{my path}/PFE-AssistiveBanking-RN/android/app/build/generated/rncli/src/main/jni/Android-rncli.cmake:7 (add_subdirectory):
add_subdirectory called with incorrect number of arguments
Call Stack (most recent call first):
C:{my path}/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:123 (include)
CMakeLists.txt:31 (include)
CMake Error at C:{my path}/android/app/build/generated/rncli/src/main/jni/Android-rncli.cmake:8 (add_subdirectory):
add_subdirectory called with incorrect number of arguments
Call Stack (most recent call first):
C:{my path}/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:123 (include)
CMakeLists.txt:31 (include)
CMake Error at C:{my path}/android/app/build/generated/rncli/src/main/jni/Android-rncli.cmake:9 (add_subdirectory):
add_subdirectory called with incorrect number of arguments
Call Stack (most recent call first):
C:{my path}/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:123 (include)
CMakeLists.txt:31 (include)
CMake Error at C:{my path}/android/app/build/generated/rncli/src/main/jni/Android-rncli.cmake:10 (add_subdirectory):
add_subdirectory called with incorrect number of arguments
Call Stack (most recent call first):
C:{my path}/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:123 (include)
CMakeLists.txt:31 (include)
CMake Error at C:{my path}/android/app/build/generated/rncli/src/main/jni/Android-rncli.cmake:11 (add_subdirectory):
add_subdirectory called with incorrect number of arguments
Call Stack (most recent call first):
C:{my path}/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:123 (include)
CMakeLists.txt:31 (include)
CMake Error at C:/{my path}/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:126 (target_link_libraries):
Cannot specify link libraries for target
"react_codegen_RNDateTimePickerCGen" which is not built by this project.
Call Stack (most recent call first):
CMakeLists.txt:31 (include)
Has anyone encountered this and found how to fix the issue, I am in dire help
I tried using yarn start --reset-cache
and .\gradlew clean
, i also tried degrading the cmake version from android studio but it didn't work, to top it off when the emulator runs for the first time , it opens many consecutive android error dialogues
android emulator error dialogue
Upvotes: 4
Views: 14901
Reputation: 21
How to Fix Build Issues in React Native by Cleaning and Disabling New Architecture?
I encountered build issues while running my React Native project on Android. Here's what I did to resolve the problem
cd android
then
gradlew clean
Disabled New Architecture
2.Edited the android/gradle.properties file and changed
newArchEnabled=true
to newArchEnabled=false
3.then
cd ..
npm start --reset-cache
npm run android
Upvotes: 2
Reputation: 595
Update react-native CLI Plugins
yarn install
npx react-native config
Delete .cxx
rm -rf android/app/.cxx
rm -rf android/app/build
Build Directories
cd android
./gradlew clean
./gradlew assembleDebug
Reset Metro Bundler Cache
rm -rf node_modules
yarn install
yarn start --reset-cache
Upvotes: 0
Reputation: 628
Hope the following steps, will solve your problems:
gradle-wrapper.properties
change the line distributionUrl=xxx
to distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
build.gradle
, update the following lines:buildscript {
ext {
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '35.0.0'
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '24')
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '35')
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.24'
ndkVersion = "26.1.10909125"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath('com.android.tools.build:gradle')
classpath('com.facebook.react:react-native-gradle-plugin')
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
}
}
apply plugin: "com.facebook.react.rootproject"
~3.16.1
for react-native-reanimated
~4.1.0
for react-native-screens
Upvotes: 0
Reputation: 1251
Inside android/gradle.properties, change newArchEnabled=true to newArchEnabled=false
Upvotes: 5
Reputation: 9
Remove the build and .cxx folder in the android/app/ directory.
Run the command in terminal:
Upvotes: 0
Reputation: 24
I was having same issue like this for react native screens Task :react-native-reanimated:configureCMakeDebug[arm64-v8a]
I just uninstalled react native screens and then installed lower version of it which was compatible with my project, then it worked.
Upvotes: 0
Reputation: 63
Since I have finally fixed it, it took me a little bit, and i am not sure if i fixed it fully but here's what i did:
Upvotes: 2