react-native-mmkv
react-native-mmkv copied to clipboard
React Native MMKV fails to build due to fbjni-0.5.0-headers.jar responding with 404
Issue description
When deploying our React Native 0.70.6 app to Android through Fastlane we're now getting failed builds with the following error;
Please refer to my issue created in FBJNI-repo and this comment.
Where:
Build file 'node_modules/react-native-mmkv/android/build.gradle' line: 322
What went wrong:
Execution failed for task ':react-native-mmkv:extractAARHeaders'.
> Could not resolve all files for configuration ':react-native-mmkv:extractHeaders'.
> Could not find fbjni-0.5.0-headers.jar (com.facebook.fbjni:fbjni:0.5.0).
Searched in the following locations:
https://repo.maven.apache.org/maven2/com/facebook/fbjni/fbjni/0.5.0/fbjni-0.5.0-headers.jar
When looking through https://repo.maven.apache.org/maven2/com/facebook/fbjni/fbjni we see that the headers file is missing only for version 0.5.0.
https://repo.maven.apache.org/maven2/com/facebook/fbjni/fbjni/0.5.0/fbjni-0.5.0-headers.jar responds in 404.
getting same error here
Same here.
same here
Same here
Same here
same here, hope this gets fixed soon
Any solution for this?
We are facing this issue as well, any updates?
What version are you using?
possible fix: https://github.com/facebookincubator/fbjni/issues/85#issuecomment-1647970138
patch (with patch-package) react-native-mmkv/android/build.gradle
//noinspection GradleDynamicVersion
- extractHeaders("com.facebook.fbjni:fbjni:+:headers")
+ extractHeaders("com.facebook.fbjni:fbjni:0.4.0:headers")
//noinspection GradleDynamicVersion
- extractJNI("com.facebook.fbjni:fbjni:+")
+ extractJNI("com.facebook.fbjni:fbjni:0.4.0")
same here
fbjni 0.5.1 released https://repo.maven.apache.org/maven2/com/facebook/fbjni/fbjni/0.5.1/
build succeed
Any updates? Even after they fixed the fbjni release, the error remains :(
You will have to clean yarn & gradle cache and try again
You will have to clean yarn & gradle cache and try again
Already did and still fails
Unfortunately, the same here
Still getting this error, tried cleaning npm and gradle.
What went wrong:
Execution failed for task ':react-native-mmkv:extractAARHeaders'.
Could not resolve all files for configuration ':react-native-mmkv:extractHeaders'.
Could not find fbjni-0.5.0-headers.jar (com.facebook.fbjni:fbjni:0.5.0).
Searched in the following locations:
https://repo.maven.apache.org/maven2/com/facebook/fbjni/fbjni/0.5.0/fbjni-0.5.0-headers.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Im also getting the same error. The file doesn't exist on the server. Just followed the link and there's no such file. This link here
/fbjni-0.5.0-headers.jar
I tried the following steps and it worked for me
- Delete gradle cache
- Restart the system
- gradle clean And it worked
I tried the following steps and it worked for me
- Delete gradle cache
- Restart the system
- gradle clean And it worked
Please add the respective commands (macOS/Unix) to your post. I would be grateful
I tried the following steps and it worked for me
- Delete gradle cache
- Restart the system
- gradle clean And it worked
Please add the respective commands (macOS/Unix) to your post. I would be grateful
Env: MacOS M1 Ventura 13.4.1 (22F82)
Delete gradle cache: rm -rf ~/.gradle/caches
Restart system
Gradle clean: cd android && ./gradlew clean
Build again: ./gradlew :app:assembleRelease
same here
The patch-package worked. However the core problem with React Native MMKV using a dynamic range of FBJNI still needs to be resolved, because even with the patch the risk of runtime crashes exists as described here; https://github.com/facebookincubator/fbjni/issues/85#issuecomment-1647826877
./gradlew :app:assembleRelease
I can confirm this solution results in a successful build, Thank you @paryanihitesh and @stiltet-gofore
Hey!
Yea the latest version of react-native-mmkv fixes this issue, make sure y'all upgrade to 2.10.1! :)
Hello! I think there is a problem in the new version of React Native when installing the library for Android and gradle does not work properly in this library. Maybe it is for me! I changed the gradle version from 7.2.2 to 7.2.1 and it worked correctly!
Hey - I think this has been fixed in V3 beta.