We are adding an Android build to our existing app so that we can support both devices. When running on EAS, the build fails with an unknown error
message.
Build 1: Build Details — 689231b1-ced4-47a1-8339-91a8da6c8b9b — delta — Expo
Build 2: Build Details — 4a77316b-d0fc-4352-89a8-cd6af92c4c94 — delta — Expo
- I am in a managed workflow, however, we use EAS
build
to support modules that are not Expo supported. - Your
eas-cli
version:eas-cli/3.9.1 darwin-arm64 node-v16.20.0
- What you have tried so far:
- running the command
eas build --profile development --platform android
from the terminal
- running the command
eas.json:
{
"cli": {
"version": ">= 2.4.1",
"promptToConfigurePushNotifications": false
},
"build": {
"m1": {
"ios": {
"resourceClass": "m-medium"
}
},
"staging": {
"extends": "m1",
"node": "16.15.0",
"yarn": "1.22.5",
"env": {
"API_ADDRESS": "ourAPI",
"LOG_API_ERRORS": "false",
"ICON": "./src/assets/icon-stage.png",
"APP_NAME": "Staging LT",
"BUNDLE_ID": "com.fluidtruck.lt.stage",
"ENABLE_DEV_FEATURES": "true"
},
"ios": {
"env": {
"PLATFORM": "ios"
},
"image": "default"
},
"android": {
"buildType": "apk"
}
},
"prod": {
"extends": "m1",
"node": "16.15.0",
"yarn": "1.22.5",
"env": {
"API_ADDRESS": "ourAPI",
"LOG_API_ERRORS": "false",
"ICON": "./src/assets/icon.png",
"APP_NAME": "LT App",
"BUNDLE_ID": "com.fluidtruck.lt"
},
"ios": {
"env": {
"PLATFORM": "ios"
},
"image": "default"
},
"android": {
"buildType": "app-bundle",
"image": "latest"
}
},
// to release to Test Flight PROD
"test-flight": {
"extends": "prod"
},
// to release to Test Flight STAGING
"test-flight:stage": {
"extends": "staging",
"env": {
"LOG_API_ERRORS": "false",
"APP_NAME": "TF Staging LT"
}
},
// for building test links
"development-internal": {
"extends": "staging",
"distribution": "internal",
"env": {
"LOG_API_ERRORS": "true",
"APP_NAME": "QA Staging LT"
}
},
// for development simulator builds with Native Module packages
"development": {
"extends": "staging",
"distribution": "internal",
"developmentClient": true,
"ios": {
"simulator": true
},
"env": {
"LOG_API_ERRORS": "true",
"APP_NAME": "Dev Sim"
}
},
// for development device builds with Native Module packages
"development-device": {
"extends": "staging",
"developmentClient": true,
"distribution": "internal",
"env": {
"LOG_API_ERRORS": "true",
"APP_NAME": "Dev Device"
}
}
}
}
and our app.config
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('dotenv').config();
const bundleIdentifier = process.env.BUNDLE_ID || 'com.fluidtruck.lt.stage';
module.exports = {
name: process.env.APP_NAME || 'Fluid LT App',
slug: 'delta',
owner: 'fluidtruck',
scheme: 'fluidlt',
version: '1.6.5', // Only change this if a true version bump is needed. Apple reviews take longer if you change this field
orientation: 'portrait',
userInterfaceStyle: 'automatic',
icon: process.env.ICON || './src/assets/delta.png',
privacy: 'unlisted',
plugins: [
'newrelic-react-native-agent',
[
'react-native-vision-camera',
{
cameraPermissionText: 'LT App needs access to your Camera.',
enableMicrophonePermission: true,
microphonePermissionText: 'LT App needs access to your Microphone.',
},
],
'react-native-compressor',
[
'expo-image-picker',
{
photosPermission: 'This app accesses your photos to let you upload from your library.',
},
],
],
splash: {
image: './src/assets/splash.png',
resizeMode: 'contain',
backgroundColor: '#ffffff',
},
updates: {
fallbackToCacheTimeout: 0,
},
assetBundlePatterns: ['./src/assets/**/*.png', './src/assets/icons/**/*.svg'],
ios: {
bundleIdentifier,
buildNumber: '1.6.11',
infoPlist: {
NSCameraUsageDescription: 'This app uses the camera to take pictures & video.',
NSMicrophoneUsageDescription: 'This app may use your microphone.',
LSApplicationQueriesSchemes: ['comgooglemaps', 'waze'],
},
},
android: {
package: bundleIdentifier,
},
web: {
favicon: './src/assets/favicon.png',
},
userInterfaceStyle: 'automatic',
extra: {
api: process.env.API_ADDRESS,
bundleIdentifier: bundleIdentifier,
log_api_errors: process.env.LOG_API_ERRORS,
newrelic_prod: process.env.NEW_RELIC_PROD,
newrelic_stage: process.env.NEW_RELIC_STAGE,
ENABLE_DEV_FEATURES: process.env.NODE_ENV === 'development' || process.env.ENABLE_DEV_FEATURES,
eas: {
projectId: 'ourID',
},
},
};
The error in the EAS logs are very vague for me:
Task :app:mergeProjectDexDebug
FAILED
[stderr] ERROR:/home/expo/workingdir/build/android/app/build/intermediates/mixed_scope_dex_archive/debug/out/cbdbd1fce5fa54770dcc0ed6b494682f30c191323ef4a22ce4760e1c895cf9e5_0.jar: D8: Type com.swmansion.reanimated.BuildConfig is defined multiple times: /home/expo/workingdir/build/android/app/build/intermediates/mixed_scope_dex_archive/debug/out/cbdbd1fce5fa54770dcc0ed6b494682f30c191323ef4a22ce4760e1c895cf9e5_0.jar:classes.dex, /home/expo/workingdir/build/android/app/build/intermediates/mixed_scope_dex_archive/debug/out/e0f9dd988ffbb736b7374aafaee19791124833e5a405f1350c7c84d63deea972_0.jar:classes.dex
Since this error I have tried:
- Fixing
expo-doctor
warnings, by downgradingreact-native-maps
(see this build). This is not the problem and we have a 2nd project in a separate repo using newer version. - Running
npx expo prebuild
locally. It successfully compiles and generatesios
andandroid
directories. However, I get an error when trying to runnpx expo run:android
:
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details
Configuration on demand is an incubating feature.
Task :react-native-gradle-plugin:compileKotlin FAILED
‘compileJava’ task (current target is 1.8) and ‘compileKotlin’ task (current target is 11) jvm target compatibility should be set to the same Java version
FAILURE: Build failed with an exception.
- What went wrong:
- Execution failed for task ‘:react-native-gradle-plugin:compileKotlin’.
Failed to query the value of task ‘:react-native-gradle-plugin:compileKotlin’ property ‘compilerRunner$kotlin_gradle_plugin’.
Kotlin could not find the required JDK tools in the Java installation. Make sure Kotlin compilation is running on a JDK, not JRE.- Try:
- Run with –stacktrace option to get the stack trace.
- Run with –info or –debug option to get more log output.
- Run with –scan to get full insights.
note: cannot run those flags since it’s a expo command
What is the best next step?