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

React Native MMKV fails to build due to fbjni-0.5.0-headers.jar responding with 404

Open stiltet-gofore opened this issue 2 years ago • 28 comments

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.

stiltet-gofore avatar Jul 24 '23 13:07 stiltet-gofore

getting same error here

Elviogabriel avatar Jul 24 '23 13:07 Elviogabriel

Same here.

tim7on avatar Jul 24 '23 13:07 tim7on

same here

JeffPatricio avatar Jul 24 '23 13:07 JeffPatricio

Same here

Gustavo-Kuze avatar Jul 24 '23 13:07 Gustavo-Kuze

Same here

likesebiii avatar Jul 24 '23 13:07 likesebiii

same here, hope this gets fixed soon

ghiculescualexandru avatar Jul 24 '23 13:07 ghiculescualexandru

Any solution for this?

lego-sharat avatar Jul 24 '23 14:07 lego-sharat

We are facing this issue as well, any updates?

ollie-trackworx avatar Jul 24 '23 14:07 ollie-trackworx

What version are you using?

lego-sharat avatar Jul 24 '23 14:07 lego-sharat

possible fix: https://github.com/facebookincubator/fbjni/issues/85#issuecomment-1647970138

williamliangwl avatar Jul 24 '23 14:07 williamliangwl

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")

zhekix avatar Jul 24 '23 14:07 zhekix

same here

thtRajasthaniGuy avatar Jul 24 '23 14:07 thtRajasthaniGuy

fbjni 0.5.1 released https://repo.maven.apache.org/maven2/com/facebook/fbjni/fbjni/0.5.1/

paryanihitesh avatar Jul 24 '23 16:07 paryanihitesh

build succeed

Yummy-sk avatar Jul 24 '23 16:07 Yummy-sk

Any updates? Even after they fixed the fbjni release, the error remains :(

marcos-cunha-gringo avatar Jul 24 '23 17:07 marcos-cunha-gringo

You will have to clean yarn & gradle cache and try again

paryanihitesh avatar Jul 24 '23 17:07 paryanihitesh

You will have to clean yarn & gradle cache and try again

Already did and still fails

CaioFernandoDev avatar Jul 24 '23 17:07 CaioFernandoDev

Unfortunately, the same here

lucalves avatar Jul 24 '23 22:07 lucalves

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 

ollie-trackworx avatar Jul 25 '23 01:07 ollie-trackworx

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

louicoder avatar Jul 25 '23 06:07 louicoder

I tried the following steps and it worked for me

  • Delete gradle cache
  • Restart the system
  • gradle clean And it worked

paryanihitesh avatar Jul 25 '23 06:07 paryanihitesh

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

louicoder avatar Jul 25 '23 06:07 louicoder

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

paryanihitesh avatar Jul 25 '23 07:07 paryanihitesh

same here

FetchefDev avatar Jul 25 '23 07:07 FetchefDev

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

stiltet-gofore avatar Jul 25 '23 09:07 stiltet-gofore

./gradlew :app:assembleRelease

I can confirm this solution results in a successful build, Thank you @paryanihitesh and @stiltet-gofore

ollie-trackworx avatar Jul 25 '23 10:07 ollie-trackworx

Hey!

Yea the latest version of react-native-mmkv fixes this issue, make sure y'all upgrade to 2.10.1! :)

mrousavy avatar Jul 31 '23 10:07 mrousavy

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!

MehrabSp avatar Aug 02 '23 20:08 MehrabSp

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

mrousavy avatar Jul 22 '24 15:07 mrousavy