Closed gangadharuseline closed 9 months ago
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
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.
try remove node_modules, reinstall and https://github.com/mrousavy/react-native-vision-camera/issues/1489#issuecomment-1451317732
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
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
@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 ✅ 🚀
For developers using older versions of Realm (https://github.com/realm/realm-js/issues/5136), consider utilizing Node version v18.19.0.
@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.
@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
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:
patch-package
npm install --save-dev patch-package postinstall-postinstall
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)
}
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.
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
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"
}
Instead of creating patches as comments, could you maybe create a PR so I can merge this upstream? Thanks
the latest MMKV version (2.11) does not have this issue.
I am trying to run npx react-native run-android The build is failing with the below error, PFA screenshot
Below is the some of the log
Here are Our App's few package.json versions are
Note: IOS app works fine.
Can you please help us here