react-native-mmkv icon indicating copy to clipboard operation
react-native-mmkv copied to clipboard

[ANDROID] Build error react-native-mmkv:configureCMakeDebug[arm64-v8a]

Open phungrs opened this issue 2 years ago • 14 comments

I got this error when building app in andoird

* What went wrong:
Execution failed for task ':react-native-mmkv:configureCMakeDebug[arm64-v8a]'.
> [CXX1428] exception while building Json A problem occurred starting process 'command '/Users/mjlt2/Library/Android/sdk/cmake/3.22.1/bin/cmake''

Env

  • "react-native": "0.72.3",
  • "react-native-mmkv": "^2.10.1"

Please help me.

image

phungrs avatar Jul 20 '23 02:07 phungrs

I fixed this issue by installing rosetta with:

softwareupdate --install-rosetta

I did a reset to my m1 macbook, and I haven't installed rosetta, but this fixed for me.


If you still have this error after enabling rosetta, take a look on these answers on stack overflow: https://stackoverflow.com/questions/73881553/error-while-executing-npx-react-native-run-android-execution-failed-for-task

rodrigotbrun avatar Jul 20 '23 04:07 rodrigotbrun

This solution is not working for me

ali03111 avatar Aug 31 '23 16:08 ali03111

I seem to have similar issue in 0.72. A problem occurred configuring project ':react-native-mmkv'.

Could not create task ':react-native-mmkv:configureCMakeDebug[armeabi-v7a]'. "react-native-mmkv": "2.10.2", "react-native": "0.72.4",

wezter96 avatar Sep 06 '23 17:09 wezter96

0.72 version uses cmake 3.22.1 by default. 0.71 version builds without a problem. project needs to upgrade its build system to cmake 3.22.1

exploitJ avatar Sep 13 '23 05:09 exploitJ

I'm also facing this issue, due to this we are not able to upgrade our project to 0.72.4. Its giving error for only debug variant and release build running successfully. Is there any update on this?

RagavendraM avatar Sep 21 '23 07:09 RagavendraM

@exploitJ , by the way, how to upgrade the project cmake

defolly avatar Sep 21 '23 08:09 defolly

@exploitJ , thanks. change the ndkVersion from 24.0.8215888 to 25.2.9519653 , it work for me.

   if (System.properties['os.arch'] == "aarch64") {
        // For M1 Users we need to use the NDK 24 which added support for aarch64
        // ndkVersion = "24.0.8215888"
        ndkVersion = "25.2.9519653"
    } else {
        // Otherwise we default to the side-by-side NDK version from AGP.
        ndkVersion = "21.4.7075529"
    }

defolly avatar Sep 21 '23 09:09 defolly

I seem to have similar issue in 0.72. A problem occurred configuring project ':react-native-mmkv'.

Could not create task ':react-native-mmkv:configureCMakeDebug[armeabi-v7a]'. "react-native-mmkv": "2.10.2", "react-native": "0.72.4",

@wezter96 did you find a solution for this ☝️

flaming-streamz avatar Oct 01 '23 07:10 flaming-streamz

Any updates? I'm having the same problem here and nothing I've tried. solved this problem.

Update: Talking with my colleague, we tried the following solutions: 1 - In your android build.gradle, set the ndk version that your mmkv version was using; 2 - Change the CMake version to compatible with the version mmkv was using 3 - Remove all ndks from C:\Users{your_user}\AppData\Local\Android\Sdk\ndk; 4 - Following this issue: https://github.com/mrousavy/react-native-mmkv/issues/483, it talks about path size, which cannot be long

For me, I followed all these steps, but only after doing the last one, I was able to solve. Also, be carefull using react-native-mmkv-storage, it uses version 23.1.7779620 of ndk, and this could causes some conflicts.

My configurations: react-native: 0.72.6 react-native-mmkv: 2.11.0 Gradle: 8.0 ndk: 25.2.9519653 CMake: 3.22.1

LeoInCode avatar Dec 11 '23 14:12 LeoInCode

Checkout if you have set _JAVA_OPTIONS

echo $_JAVA_OPTIONS

If so, unset it and try it again:

unset _JAVA_OPTIONS
yarn android

This fixed it for me. I don't know why. I set it because I had some troubles in the past with ipv6.

patlux avatar Dec 20 '23 13:12 patlux

Try following these steps This worked for me just by uninstalling and installing cmake through the SDK manager.

rada avatar Jan 14 '24 04:01 rada

Are you using react-native-notifications ? Ensure you have followed https://wix.github.io/react-native-notifications/docs/installation-android if so.

x43n avatar Mar 20 '24 22:03 x43n

build system to cmake 3.22.1

How to do this

omnaladkar avatar Mar 22 '24 11:03 omnaladkar

ask your manager rahul

vaibhavw12 avatar Apr 23 '24 09:04 vaibhavw12

Hey - I think this has been fixed in V3 beta.

mrousavy avatar Jul 22 '24 15:07 mrousavy

To compliment, if you're still on v2.x and having the Android issue, just clean the gradle caches with the command ./gradlew clean on your Android native directory, then rebuild, and in case you're in Expo SDK 50 or 51, don't forget to run under a development client (expo-dev-client) build using npx expo run:android. This is more of a building issue, so I hope this works for someone using an older version.

Marc already fixed this on v3 but be aware that requires the new architecture enabled.

oliverloops avatar Jul 25 '24 22:07 oliverloops

Hey, I'm having the same issue even after upgrading to the the latest v3 beta and with the new architecture enabled. My project's using expo SDK 51 an RN 0.74.3. The only time my app builds on android is when I downgrade to v2 and disable fabric.

Any updates/ideas on this? Maybe @oliverloops would have an idea, I'd really appreciate anything at this point

UPDATE: seems like v3 beta 6 and 7 do in fact work, some other packages were failing on my end

ashtar23 avatar Jul 31 '24 17:07 ashtar23