I am adding a small video editing feature to a live Expo app using ffmpeg-kit-react-native library. While the app can run smoothly on web-dev and Expo Go, it always fails to build a production version using EAS-CLI. Before the library is installed, there was no any build problem at all.
I am using:
eas-cli 3.10.0
nodeJS 18.15.0
npm 9.5.0
MacOS 10.15
Visual Studio Code 1.77.3
package.json>
"dependencies": { "@config-plugins/ffmpeg-kit-react-native": "^5.0.0", "@expo/webpack-config": "^18.0.1", "@react-native-async-storage/async-storage": "1.17.11", "@react-native-community/masked-view": "^0.1.11", "@react-navigation/material-bottom-tabs": "^6.2.12", "@react-navigation/native": "^6.1.3", "@react-navigation/stack": "^6.3.12", "@reduxjs/toolkit": "^1.9.2", "@sentry/react-native": "4.13.0", "axios": "^1.3.3", "expo": "^48.0.10", "expo-application": "~5.1.1", "expo-av": "~13.2.1", "expo-build-properties": "~0.6.0", "expo-camera": "~13.2.1", "expo-clipboard": "~4.1.2", "expo-constants": "~14.2.1", "expo-device": "~5.2.1", "expo-file-system": "~15.2.2", "expo-image-picker": "~14.1.1", "expo-modules-core": "~1.2.5", "expo-navigation-bar": "~2.1.1", "expo-screen-orientation": "~5.1.1", "expo-sharing": "~11.2.2", "expo-status-bar": "~1.4.4", "expo-updates": "~0.16.4", "fbjs": "^3.0.4", "ffmpeg-kit-react-native": "^5.1.0", "moment": "^2.29.4", "react": "18.2.0", "react-dom": "^18.2.0", "react-native": "0.71.6", "react-native-gesture-handler": "^2.9.0", "react-native-global-props": "^1.1.5", "react-native-image-slider-banner": "^1.0.3", "react-native-paper": "^5.1.4", "react-native-radio-buttons-group": "^2.3.1", "react-native-raw-bottom-sheet": "^2.2.0", "react-native-render-html": "^6.3.4", "react-native-safe-area-context": "4.5.0", "react-native-safe-area-view": "^1.1.1", "react-native-screens": "~3.20.0", "react-native-svg": "13.4.0", "react-native-vector-icons": "^9.2.0", "react-native-view-shot": "3.5.0", "react-native-web": "^0.18.12", "react-native-webview": "11.26.0", "react-redux": "^8.0.5", "redux": "^4.2.1", "redux-thunk": "^2.4.2", "sentry-expo": "~6.1.0" }, "devDependencies": { "@babel/core": "^7.12.9", "eslint-plugin-react-hooks": "^4.6.0" }, "private": true, "resolutions": { "@expo/config-plugins": "^6.0.0" }
app.json
"plugins": [ [ "expo-screen-orientation", { "initialOrientation": "PORTRAIT" } ], "sentry-expo", [ "@config-plugins/ffmpeg-kit-react-native", { "package": "video" } ], [ "expo-build-properties", { "android": { "compileSdkVersion": 31, "targetSdkVersion": 31, "minSdkVersion": 24, "buildToolsVersion": "31.0.0", "packagingOptions": { "pickFirst": [ "lib/arm64-v8a/libc++_shared.so", "lib/armeabi-v7a/libc++_shared.so", "lib/x86/libc++_shared.so", "lib/x86_64/libc++_shared.so" ] } }, "ios": { "deploymentTarget": "13.0" } } ] ],
Here is the gradlew error log on EAS:
[stderr] FAILURE: Build completed with 2 failures.
1294[stderr] 1: Task failed with an exception.
1295[stderr] -----------
1296[stderr] * What went wrong:
1297[stderr] Execution failed for task ':expo-image-picker:compileReleaseKotlin'.
1298[stderr] > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
1299[stderr] > Compilation error. See log for more details
1300[stderr] * Try:
1301[stderr] > Run with --stacktrace option to get the stack trace.
1302[stderr] > Run with --info or --debug option to get more log output.
1303[stderr] > Run with --scan to get full insights.
1304[stderr] ==============================================================================
1305[stderr] 2: Task failed with an exception.
1306[stderr] -----------
1307[stderr] * What went wrong:
1308[stderr] java.lang.StackOverflowError (no error message)
1309[stderr] * Try:
1310[stderr] > Run with --stacktrace option to get the stack trace.
1311[stderr] > Run with --info or --debug option to get more log output.
1312[stderr] > Run with --scan to get full insights.
1313[stderr] ==============================================================================