You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CMake error for using react-native-mmkv-storage with Android.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-mmkv-storage:configureCMakeDebug'.
> C/C++: /home/jawa/Repositories/canto/node_modules/react-native-mmkv-storage/android/src/main/rnmmkv/CMakeLists.txt debug|armeabi-v7a : CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
REACT_NATIVE_JNI_LIB
linked by target "rnmmkv" in directory /home/jawa/Repositories/canto/node_modules/react-native-mmkv-storage/android/src/main/rnmmkv
In the Android Studio SDK Manager, install CMake 3.10 and make sure it is the only version available.
In the Android Studio Manager, install NDK 21.4.7075529 and make sure it is the only version available.
Specify CMake version at MMKV's build.gradle file.
Automated option: run the fix-mmkv script: yarn fix-mmkv (also included in the yarn android script)
Manual option: enter node_modules/react-native-mmkv-storage/android/build.gradle and make sure that the CMake version above is specified at externalNativeBuild. Like so:
externalNativeBuild {
cmake {
path "./src/main/rnmkv/CMakeLists.txt"
version "3.10.2"
}
}
The previous steps came from this related discussion. If they didn´t work, try the following:
4. Delete and reinstall node_modules, apply step 3
5. Clean your project with ./gradlew clean or Android Studio
6. In Android Studio, run Build -> Refresh Linked C++ Projects
The current build process is not deterministic. The previous steps work sometimes, fail others. I am still trying to figure it out. Currently, follow steps 1 to 3 and repeat 5 and 6 untill the project can be built (help needed).
This specific order in Android Studio seems to always work: Build/Clean, Build/Refresh Linked C++ Projects, Build/Make Project, Build/Make Project (yes, build twice, ignore the errors, only the last make should end correctly). Be sure that metro is not running while you do it. Then running yarn android should work.
The text was updated successfully, but these errors were encountered:
Build error:
CMake error for using
react-native-mmkv-storage
with Android.Current work-around:
This project uses react-native-mmkv-storage. If the project wont build after following the installation instrunctions, you may need to follow these steps:
In the Android Studio SDK Manager, install CMake 3.10 and make sure it is the only version available.
In the Android Studio Manager, install NDK 21.4.7075529 and make sure it is the only version available.
Specify CMake version at MMKV's
build.gradle
file.Automated option: run the
fix-mmkv
script:yarn fix-mmkv
(also included in theyarn android
script)Manual option: enter
node_modules/react-native-mmkv-storage/android/build.gradle
and make sure that the CMake version above is specified atexternalNativeBuild
. Like so:The previous steps came from this related discussion. If they didn´t work, try the following:
4. Delete and reinstall node_modules, apply step 35. Clean your project with./gradlew clean
or Android Studio6. In Android Studio, run Build -> Refresh Linked C++ ProjectsThe current build process is not deterministic. The previous steps work sometimes, fail others. I am still trying to figure it out. Currently, follow steps 1 to 3 and repeat 5 and 6 untill the project can be built (help needed).Build/Clean
,Build/Refresh Linked C++ Projects
,Build/Make Project
,Build/Make Project
(yes, build twice, ignore the errors, only the last make should end correctly). Be sure that metro is not running while you do it. Then runningyarn android
should work.The text was updated successfully, but these errors were encountered: