Code Monkey home page Code Monkey logo

Comments (14)

buiphuclam avatar buiphuclam commented on June 2, 2024 2

try remove node_modules, reinstall and mrousavy/react-native-vision-camera#1489 (comment)

from react-native-mmkv.

gangadharuseline avatar gangadharuseline commented on June 2, 2024 1

@deepanshu-ample @Kavahardik
Yes, The issue was fixed to me.

What i did is,
Actually I use nvm to manage my node,
Earlier I am using the node version => v16.20.2
Now I had installed latest node lts version i.e v20.10.0
After pointing to node version => v20.10.0 - I am not seeing the above prepareBoost issue
our app runs successfully

from react-native-mmkv.

anirudh-antino avatar anirudh-antino commented on June 2, 2024 1

@gangadharuseline You can download boost_1_76_0.tar.gz file from here https://source.ipfire.org/source-2.x/
In your case you can download it via this link: https://source.ipfire.org/source-2.x/boost_1_76_0.tar.gz

then just copy it to App/node_modules/react-native-mmkv/android/build/downloads/boost_1_76_0.tar.gz and build your app.

Note: you need to do this every time you run yarn or npm. I usually do this since since it downloads this file every time and it is very slow to download.

from react-native-mmkv.

alexanderhodes avatar alexanderhodes commented on June 2, 2024 1

The problem that you're facing is related to the general problem in the React Native Community regarding the broken download url from JFrog.
The React Native team is already working on a solution for it. You can follow the complete progress in this issue.

A temporary fix that worked on my build have been these steps:

  1. Install patch-package
npm install --save-dev patch-package postinstall-postinstall
  1. Modify build.gradle

You can find this file locally on your machine here: node_modules/react-native-mmkv/android/build.gradle

Change this line:

task downloadBoost(dependsOn: createNativeDepsDirectories, type: Download) {
  def transformedVersion = BOOST_VERSION.replace("_", ".")

  // change this line
  def srcUrl = "https://boostorg.jfrog.io/artifactory/main/release/${transformedVersion}/source/boost_${BOOST_VERSION}.tar.gz"
  // to this
  def srcUrl = "https://archives.boost.io/release/${transformedVersion}/source/boost_${BOOST_VERSION}.tar.gz"
  if (REACT_NATIVE_VERSION < 69) {
    srcUrl = "https://github.com/react-native-community/boost-for-react-native/releases/download/v${transformedVersion}-0/boost_${BOOST_VERSION}.tar.gz"
  }
  src(srcUrl)
  onlyIfNewer(true)
  overwrite(false)
  dest(boost_file)
}
  1. Create patch

You need to run npx patch-package react-native-mmkv to create the patch which will be applied. This will generate a patch file in the patches/ folder in your project.

  1. Add postinstall script to package.json

You need to app the following script into your package.json

"scripts": {
     "postinstall": "patch-package"
}

Afterwards, you can commit all files. This should fix your broken build. These changes will be applied automacially in your CI/ CD pipeline as well. There's no need to change this on every commit or push.

The steps are inspired by this post

from react-native-mmkv.

deepanshu-sharma09 avatar deepanshu-sharma09 commented on June 2, 2024

Have you been able to resolve this??

Execution failed for task ':react-native-mmkv:prepareBoost'.
> Could not read /.../App/node_modules/react-native-mmkv/android/build/downloads/boost_1_76_0.tar.gz.
   > Not in GZIP format

from react-native-mmkv.

Kavahardik avatar Kavahardik commented on June 2, 2024

Execution failed for task ':react-native-mmkv:prepareBoost'.

Could not read /Users/peer/Documents/V3.1/Dipon/DiponMerchant/node_modules/react-native-mmkv/android/build/downloads/boost_1_76_0.tar.gz.
Not in GZIP format

Facing same issue.

from react-native-mmkv.

ajay-mandaviya avatar ajay-mandaviya commented on June 2, 2024

Facing same issue :
"react": "18.1.0", "react-native": "0.70.6", "react-native-mmkv": "2.5.1",
node version: v20.6.1
`* What went wrong:
Execution failed for task ':react-native-mmkv:prepareBoost'.

Could not read /Project-path/node_modules/react-native-mmkv/android/build/downloads/boost_1_76_0.tar.gz.
Not in GZIP format`
Getting same error in react-native-reanimated

from react-native-mmkv.

ajay-mandaviya avatar ajay-mandaviya commented on June 2, 2024

@deepanshu-ample @Kavahardik

Yes, The issue was fixed to me.
What i did is, Actually I use nvm to manage my node, Earlier I am using the node version => v16.20.2 Now I had installed latest node lts version i.e v20.10.0 After pointing to node version => v20.10.0 - I am not seeing the above prepareBoost issue our app runs successfully

Updating node version to v20.10.0 run successfully โœ… ๐Ÿš€

from react-native-mmkv.

deepanshu-sharma09 avatar deepanshu-sharma09 commented on June 2, 2024

For developers using older versions of Realm (realm/realm-js#5136), consider utilizing Node version v18.19.0.

from react-native-mmkv.

brianwestphal avatar brianwestphal commented on June 2, 2024

See similar software-mansion/react-native-reanimated#5542

Raised boostorg/boost#849

from react-native-mmkv.

vasudhakorva avatar vasudhakorva commented on June 2, 2024

@deepanshu-ample @Kavahardik

Yes, The issue was fixed to me.
What i did is, Actually I use nvm to manage my node, Earlier I am using the node version => v16.20.2 Now I had installed latest node lts version i.e v20.10.0 After pointing to node version => v20.10.0 - I am not seeing the above prepareBoost issue our app runs successfully

Updating node version to v20.10.0 run successfully โœ… ๐Ÿš€

We are facing the same issue . In which file did u add the node version

from react-native-mmkv.

retyui avatar retyui commented on June 2, 2024

patch-package patch

diff --git a/node_modules/react-native-mmkv/android/build.gradle b/node_modules/react-native-mmkv/android/build.gradle
index 13eae76..bc8dc83 100644
--- a/node_modules/react-native-mmkv/android/build.gradle
+++ b/node_modules/react-native-mmkv/android/build.gradle
@@ -204,7 +204,7 @@ task createNativeDepsDirectories {

 task downloadBoost(dependsOn: createNativeDepsDirectories, type: Download) {
   def transformedVersion = BOOST_VERSION.replace("_", ".")
-  def srcUrl = "https://boostorg.jfrog.io/artifactory/main/release/${transformedVersion}/source/boost_${BOOST_VERSION}.tar.gz"
+  def srcUrl = "https://archives.boost.io/release/${transformedVersion}/source/boost_${BOOST_VERSION}.tar.gz"
   if (REACT_NATIVE_VERSION < 69) {
     srcUrl = "https://github.com/react-native-community/boost-for-react-native/releases/download/v${transformedVersion}-0/boost_${BOOST_VERSION}.tar.gz"
   }

from react-native-mmkv.

mrousavy avatar mrousavy commented on June 2, 2024

Instead of creating patches as comments, could you maybe create a PR so I can merge this upstream? Thanks

from react-native-mmkv.

mrousavy avatar mrousavy commented on June 2, 2024

the latest MMKV version (2.11) does not have this issue.

from react-native-mmkv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.