I'm trying to build my React Native app using EAS Build locally and also directly with Gradle. The build consistently fails with a JAR file creation error related to the react-native-vision-camera-face-detector package.
Commands tried:
eas build -p android --profile release-apk --local
and,
cd android && gradle clean && rm -r .gradle && gradle wrapper
Current Error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':react-native-vision-camera-face-detector'.
> java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to create Jar file /Users/bccca/.gradle/caches/jars-9/18366b31678c0171857be093a3b8ec22/bcprov-jdk18on-1.79.jar.
Environment
- React Native: 0.74.5
- Expo SDK: 51.0.34
- EAS CLI: 16.20.4
- Gradle: 8.2.1
- macOS: Latest
- Android Gradle Plugin: 8.2.1
Project Setup
The project uses:
- React Native with Expo
- Multiple native dependencies including:
react-native-vision-camera: 4.4.0react-native-vision-camera-face-detector: ^1.7.1@react-native-firebase/app: ^17.4.3@react-native-firebase/messaging: ^17.4.3
What I've Tried
Multiple cache clearing attempts:
cd android && ./gradlew clean rm -rf ~/.gradle/caches rm -r .gradle gradle wrapperTried building directly with Gradle:
./gradlew :app:assembleRelease --stacktraceMy gradle.properties has:
android.jetifier.ignorelist=bcprov-jdk18on
Build Output Context
The build shows successful configuration of most modules:
- All Expo modules configure successfully
- Firebase modules configure successfully
- VisionCamera configures successfully with Frame Processors enabled
- Failure occurs specifically during
react-native-vision-camera-face-detectorconfiguration
Error Analysis
The error occurs when Gradle tries to create a JAR file for bcprov-jdk18on-1.79.jar (Bouncy Castle cryptography library). This seems to be a dependency of the face detector package.
The specific JAR path that fails:
/Users/bccca/.gradle/caches/jars-9/18366b31678c0171857be093a3b8ec22/bcprov-jdk18on-1.79.jar
Questions
Is this a known issue with
react-native-vision-camera-face-detectorand the Bouncy Castle dependency?Should I try:
- Downgrading the face detector package?
- Adding specific Gradle configurations for Bouncy Castle?
- Using a different face detection solution?
Could this be a file permissions issue or macOS-specific problem with JAR creation?
Package.json Dependencies (Relevant)
{
"dependencies": {
"expo": "~51.0.34",
"react-native": "0.74.5",
"react-native-vision-camera": "4.4.0",
"react-native-vision-camera-face-detector": "^1.7.1",
"@react-native-firebase/app": "^17.4.3",
"@react-native-firebase/messaging": "^17.4.3",
"react-native-worklets-core": "1.3.3"
}
}
Any guidance on resolving this apk creation issue would be greatly appreciated!