I have made a react native app with the help of expo framework. But when I try building, it failed many times
This is my enviroment
EAS CLI 3.15.0 environment info:
System:
OS: Windows 10 10.0.19045
Binaries:
Node: 17.9.0 - D:Nodenode.EXE
npm: 8.5.5 - D:Nodenpm.CMD
Utilities:
Git: 2.41.0.
npmPackages:
expo: ^47.0.0 => 47.0.14
react: 18.1.0 => 18.1.0
react-native: 0.70.8 => 0.70.8
Project workflow: managed
This is error log.
1278 439 actionable tasks: 439 executed
1279 FAILURE: Build completed with 2 failures.
1280 1: Task failed with an exception.
1281-----------
1282* What went wrong:
1283 Execution failed for task ':expo-modules-core:prepareBoost'.
1284 > Could not read /home/expo/workingdir/build/node_modules/expo-modules-core/android/build/downloads/boost_1_76_0.tar.gz.
1285 > Not in GZIP format
1286 * Try:
1287 > Run with --stacktrace option to get the stack trace.
1288 > Run with --info or --debug option to get more log output.
1289 > Run with --scan to get full insights.
1290 ==============================================================================
1291 2: Task failed with an exception.
1292 -----------
1293 * What went wrong:
1294 java.lang.StackOverflowError (no error message)
1295 * Try:
1296 > Run with --stacktrace option to get the stack trace.
1297 > Run with --info or --debug option to get more log output.
1298 > Run with --scan to get full insights.
1299 ==============================================================================
I tried rebuilding three times and nothing happen. It still failed
3
Answers
only need to uninstall your @react-native-community/cli-platform-android package and reinstall it. It work for me!
I have found a temporary solution for this until the actual problem will be fixed. Also available on the following GitHub page
https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION.replace("_", ".")}/source/boost_${BOOST_VERSION}.tar.gz
https://archives.boost.io/release/${BOOST_VERSION.replace("_", ".")}/source/boost_${BOOST_VERSION}.tar.gz
npx patch-package expo-modules-core
I could make local builds using
npx expo run:android
from this point. If the issue keeps happening, to the exact same thing at the following file.node_modules > react-native > ReactAndroid > build.gradle
Explanation
The first error is happening because the file from the link that should be downloaded is offline and can not be downloaded resulting in an error. The new link is a mirror site containing the same files which you can use.
Note: that this is a solution to the first error.
Install this package,
This solved my problem.