React Native Build Fails with expo-modules-core:prepareBoost Error: "Not in GZIP Format" - Stack Overflow

admin2025-05-01  0

I'm facing an issue while building my React Native project. The build fails with the following error related to expo-modules-core:

Execution failed for task ':expo-modules-core:prepareBoost'.
> Could not read C:\Users\netwo\Desktop\Ekhool Project\Android Project\expo-app\node_modules\expo-modules-core\android\build\downloads\boost_1_76_0.tar.gz.
   > Not in GZIP format
  • React Native version: 0.69.5

  • Expo SDK version: Ejected (SDK 46)

  • Environment:

    • OS: Windows

    • Gradle Version: 7.4.2

    • JDK: OpenJDK 11

This error seems to be caused by a corrupted or incomplete boost_1_76_0.tar.gz file in the expo-modules-core dependency.

  1. How can I ensure that the boost_1_76_0.tar.gz file is correctly downloaded?

  2. Are there any alternative ways to bypass or fix this issue without modifying the expo-modules-core package?

  3. Is there a specific Boost version or manual installation process I should follow to resolve this?

I'm facing an issue while building my React Native project. The build fails with the following error related to expo-modules-core:

Execution failed for task ':expo-modules-core:prepareBoost'.
> Could not read C:\Users\netwo\Desktop\Ekhool Project\Android Project\expo-app\node_modules\expo-modules-core\android\build\downloads\boost_1_76_0.tar.gz.
   > Not in GZIP format
  • React Native version: 0.69.5

  • Expo SDK version: Ejected (SDK 46)

  • Environment:

    • OS: Windows

    • Gradle Version: 7.4.2

    • JDK: OpenJDK 11

This error seems to be caused by a corrupted or incomplete boost_1_76_0.tar.gz file in the expo-modules-core dependency.

  1. How can I ensure that the boost_1_76_0.tar.gz file is correctly downloaded?

  2. Are there any alternative ways to bypass or fix this issue without modifying the expo-modules-core package?

  3. Is there a specific Boost version or manual installation process I should follow to resolve this?

Share Improve this question asked Jan 2 at 14:51 GowthamGowtham 1111 silver badge12 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 7

Fixed the Issue with Boost Library

Step 1: Update URL in ReactAndroid Build Script

Navigate to the file: /node_modules/react-native/ReactAndroid/build.gradle

Locate the following line:

https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION.replace("_", ".")}/source/boost_${BOOST_VERSION}.tar.gz

Replace it with:

https://archives.boost.io/release/${BOOST_VERSION.replace("_", ".")}/source/boost_${BOOST_VERSION}.tar.gz

Step 2: Update URL in Expo Modules Core

Go to the file: /node_modules/expo-modules-core/android/build.gradle. Search for the same URL as in Step 1. Replace it with the new URL provided in Step 1. Step 3: Apply the Patches

After making the changes, run the following commands to apply the patches:

patch-package react-native
patch-package expo-modules-core

We need to install patch-package first. npm i -D patch-package and add "postinstall": "patch-package" to package.json

I was able to fix it by changing the url that was not working in these two files (when adding it only in node_modules/react-native, the expo-modules-core error appeared) new url: "https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.gz/download"

node_modules/react-native/ReactAndroid/android/build.gradle

node_modules/expo-modules-core/android/build.gradle

and then

cd android && ./gradlew clean

转载请注明原文地址:http://anycun.com/QandA/1746111865a91833.html