Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution failed for task ':expo-modules-core:downloadBoost' #26302

Closed
Jean-Bekker opened this issue Jan 8, 2024 · 6 comments
Closed

Execution failed for task ':expo-modules-core:downloadBoost' #26302

Jean-Bekker opened this issue Jan 8, 2024 · 6 comments
Labels
needs review Issue is ready to be reviewed by a maintainer

Comments

@Jean-Bekker
Copy link

Minimal reproducible example

Using package.json: { "private": true, "dependencies": { "@babel/plugin-proposal-export-namespace-from": "^7.18.9", "@cellfind/react-native-calendar-datepicker": "https://github.com/Cellfind/react-native-calendar-datepicker/archive/year-edit.tar.gz", "@expo/vector-icons": "^13.0.0", "@react-native-community/cli-platform-android": "^13.2.0", "@react-native-community/masked-view": "0.1.10", "@react-native-community/netinfo": "9.3.0", "@react-navigation/bottom-tabs": "^5.9.2", "@react-navigation/drawer": "^5.9.3", "@react-navigation/native": "^5.7.6", "@react-navigation/stack": "^5.9.3", "axios": "^0.19.2", "crap": "git+https://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:x-oauth-basic@github.com/Cellfind/crap.git", "deprecated-react-native-prop-types": "^4.0.0", "expo": "^46.0.0", "expo-app-loading": "~2.1.0", "expo-application": "~4.2.2", "expo-asset": "~8.6.3", "expo-constants": "~13.2.4", "expo-device": "~4.3.0", "expo-font": "~10.2.0", "expo-location": "~14.3.0", "expo-notifications": "~0.16.1", "expo-permissions": "~13.2.0", "expo-splash-screen": "~0.16.2", "expo-status-bar": "~1.4.0", "expo-updates": "~0.14.7", "lodash": "^4.17.19", "lottie-react-native": "5.1.3", "moment": "2.29.1", "patch-package": "^8.0.0", "postinstall-postinstall": "^2.1.0", "react": "18.0.0", "react-dom": "18.0.0", "react-native": "0.69.9", "react-native-elements": "^3.4.3", "react-native-gesture-handler": "~2.5.0", "react-native-gradle-plugin": "0.70.3", "react-native-iphone-x-helper": "^1.2.1", "react-native-maps": "0.31.1", "react-native-material-buttons": "^0.6.0", "react-native-material-dropdown-v2-fixed": "^0.11.3", "react-native-paper": "^5.2.0", "react-native-reanimated": "~2.9.1", "react-native-safe-area-context": "4.3.1", "react-native-screens": "~3.15.0", "react-native-timer": "^1.3.6", "react-native-vector-icons": "^9.2.0", "react-native-web": "~0.18.7", "react-navigation": "^4.4.4", "react-navigation-drawer": "^2.7.2", "react-navigation-stack": "^2.10.4", "react-navigation-tabs": "^2.11.2", "react-redux": "^7.1.0", "redux": "^4.0.1", "redux-persist": "^5.10.0", "redux-thunk": "^2.3.0", "sentry-expo": "~5.0.0" }, "devDependencies": { "@babel/core": "^7.12.9", "babel-preset-expo": "~9.2.0", "jest-expo": "^46.0.0" }, "assetBundlePatterns": [ "assets/**/*" ], "postinstall": "patch-package", "name": "miassist-react-native", "version": "1.0.0", "scripts": { "postinstall": "patch-package", "start": "expo start --dev-client", "android": "expo run:android", "ios": "expo run:ios" } }

Summary

Android builds fail on SDK 46 with the following error

  • What went wrong:
    Execution failed for task ':expo-modules-core:downloadBoost'.

A failure occurred while executing de.undercouch.gradle.tasks.download.internal.DefaultWorkerExecutorHelper$DefaultWorkAction
java.util.zip.ZipException: Not in GZIP format

Environment

expo-env-info 1.0.5 environment info:
System:
OS: macOS 14.0
Shell: 5.9 - /usr/local/Cellar/zsh/5.9/bin/zsh
Binaries:
Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.8.1 - ~/.nvm/versions/node/v18.17.1/bin/npm
Managers:
CocoaPods: 1.14.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.2, iOS 17.2, macOS 14.2, tvOS 17.2, watchOS 10.2
IDEs:
Android Studio: 2022.3 AI-223.8836.35.2231.10671973
Xcode: 15.1/15C65 - /usr/bin/xcodebuild
npmPackages:
babel-preset-expo: ~9.2.0 => 9.2.2
expo: ^46.0.0 => 46.0.21
react: 18.0.0 => 18.0.0
react-dom: 18.0.0 => 18.0.0
react-native: 0.69.9 => 0.69.9
react-native-web: ~0.18.7 => 0.18.12
react-navigation: ^4.4.4 => 4.4.4
npmGlobalPackages:
eas-cli: 5.9.3
expo-cli: 6.3.10
Expo Workflow: managed

@Jean-Bekker Jean-Bekker added the needs validation Issue needs to be validated label Jan 8, 2024
@expo-bot expo-bot added needs review Issue is ready to be reviewed by a maintainer and removed needs validation Issue needs to be validated labels Jan 8, 2024
@fxamauri
Copy link

fxamauri commented Jan 8, 2024

probably related facebook/react-native#42180

@alexanderhodes
Copy link

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/expo-modules-core/android/build.gradle

Change this line:

def downloadBoost = tasks.create('downloadBoost', Download) {
  dependsOn(createNativeDepsDirectories)
  def srcUrl = REACT_NATIVE_TARGET_VERSION >= 69
  // change this line
    ? "https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION.replace("_", ".")}/source/boost_${BOOST_VERSION}.tar.gz"
  // to this line
    ? "https://archives.boost.io/release/${BOOST_VERSION.replace("_", ".")}/source/boost_${BOOST_VERSION}.tar.gz"
    : "https://github.com/react-native-community/boost-for-react-native/releases/download/v${BOOST_VERSION.replace("_", ".")}-0/boost_${BOOST_VERSION}.tar.gz"
  src(srcUrl)
  onlyIfNewer(true)
  overwrite(false)
  dest(new File(downloadsDir, "boost_${BOOST_VERSION}.tar.gz"))
}

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 expo-modules-core 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

@faroukBenarous
Copy link

faroukBenarous commented Jan 8, 2024

If you have a pipeline that's failing because of this just add these two linux commands, For me i had only two packages depending on the boost.tar package (expo-modules-core, react-native-reanimated) check if you have more just update the seed command accordingly

sed -i '376s@.*@? "https://archives.boost.io/release/1.76.0/source/boost_1_76_0.tar.gz "@' node_modules/expo-modules-core/android/build.gradle

sed -i '785s@.*@def srcUrl = "https://archives.boost.io/release/1.76.0/source/boost_1_76_0.tar.gz "@' node_modules/react-native-reanimated/android/build.gradle

@wodin
Copy link
Contributor

wodin commented Jan 9, 2024

There are several people on Discord who have run into this Boost problem with expo-modules-core and, while I cannot reproduce the problem myself, using patch-package to update the URL as mentioned in @alexanderhodes' comment above seems to fix it for them.

NOTE: This Boost download is no longer in the expo-modules-core build.gradle in Expo SDK 50

@alanjhughes
Copy link
Collaborator

This has been resolved for now and a more permanent fix will be released soon. As @alexanderhodes commented, see this issue for more details.

@wodin
Copy link
Contributor

wodin commented Jan 9, 2024

Hi @alanjhughes

The React Native issue is the same sort of thing, but it's not actually the same issue.
This one is in expo-modules-core when building for Android.
The React Native issue is in React Native itself when building for iOS.

Based on discussing with Kadi and looking at the code, this bug affects people running Expo SDK <= 47.
SDK 48 and 49 do not download Boost and SDK 50 removes the download code completely.

When you say "a more permanent fix will be released soon", do you mean that there's a plan to release an update to expo-modules-core on the Expo SDK 47 branch? Or are you referring to the React Native fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

7 participants