Closed RichardLindhout closed 3 years ago
C/C++ debug|x86 : 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 "cpp" in directory /android REACT_NATIVE_UTILS_LIB
Delete node_modules
folder. Run yarn
and then run yarn react-native run-android
.
If you still face this problem. Let me know your RN version.
Also did this error show up in Android Studio?
This did show up in android studio when I rebuild library project
I'm on the latest release candidate of React Native right now
This did show up in android studio when I rebuild library project
Run yarn react-native run-android
first then rebuild in Android Studio. The aar files are not complied so they are not resolved.
Run yarn react-native run-android first then rebuild in Android Studio
Some CI systems like AppCenter use rebuild command to make build - ./gradlew clean assembleRelease
and got that error.
Looks like we should have some other solution here
Run yarn react-native run-android first then rebuild in Android Studio
Some CI systems like AppCenter use rebuild command to make build -
./gradlew clean assembleRelease
and got that error. Looks like we should have some other solution here
The solution is implemented at react-native-mmkv-storage
library.
You can look at the source files. android/build.gradle file.
Here's how I fixed it:
tasks.whenTaskAdded { task ->
if (task.name.contains('generateJsonModelDebug') || task.name.contains('externalNativeBuild')) {
task.dependsOn(extractJNIFiles);
}
if (task.name.contains('generateJsonModelRelease')) {
task.dependsOn(extractJNIFilesForRelease)
}
}
This is present at the bottom of file here, it's slightly different however you just need to copy the conditions and extractJNIForRelease
function
Cool, thanks for answer! I'll check it soon on my side
C/C++ debug|x86 : 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 "cpp" in directory /android REACT_NATIVE_UTILS_LIB