Wiem Ben yahia
Wiem Ben yahia

Reputation: 63

I got Execution failed for task ':app:configureCMakeDebug[arm64-v8a]' while building my react native app

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

Answers (7)

Sameera Jayakodi
Sameera Jayakodi

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

  1. 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

Karma
Karma

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

hgq287
hgq287

Reputation: 628

Hope the following steps, will solve your problems:

  1. In the file gradle-wrapper.properties change the line distributionUrl=xxx to distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
  2. In the file 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"

  1. Please noted that, with the ReactNative 0.76.x, I used:
  • ~3.16.1 for react-native-reanimated
  • ~4.1.0 for react-native-screens

Upvotes: 0

O Thạnh Ldt
O Thạnh Ldt

Reputation: 1251

Inside android/gradle.properties, change newArchEnabled=true to newArchEnabled=false

Upvotes: 5

Rahul Siwal
Rahul Siwal

Reputation: 9

Resolved by following steps

Remove the build and .cxx folder in the android/app/ directory.

Run the command in terminal:

  • cd android
  • ./gradlew clean

Change in file

  • Open "android/gradle.properties" file
  • Change "newArchEnabled=true" to "newArchEnabled=false"

Run the project :

  • cd ..
  • npm start --reset-cache
  • npm run android

Upvotes: 0

Manish Singh
Manish Singh

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

Wiem Ben yahia
Wiem Ben yahia

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:

  1. deleted the older AVD i have and made a new one.
  2. in my project directory, i deleted the /.gradle and the /.idea (kept a back up of this one just in case).
  3. navigated to /.gradle directory in my user directory and deleted , caches, daemon and wrapper folders.
  4. under the same user directory i navigated to /.android and deleted , cache.
  5. restarted my pc
  6. lastly, reopened my project , in the terminal: cd android and then ./gradlew assembleRelease. and when i ran it, it worked but there's still some issues in another project for some reason.

Upvotes: 2

Related Questions