Android build fail - Execution failed for task ':app:mergeExtDexRelease'.

Hi everyone!

When I tried to do either an ANDROID production or a development build of my Expo react native project, I’m encountering an issue with the execution of the task ‘:app:mergeExtDexRelease’. I’ve tried all the possible solutions that does not involve changing the android/app/build.gradle or android/gradle.properties

Error:

> Task :expo:bundleLibResRelease
> Task :app:mergeExtDexRelease FAILED
> Task :app:createBundleReleaseJsAndAssets_SentryUploadCleanUp SKIPPED
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/8.0.1/userguide/command_line_interface.html#sec:command_line_warnings
880 actionable tasks: 880 executed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeExtDexRelease'.
> Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
   > Failed to transform okio-jvm-3.5.0.jar (com.squareup.okio:okio-jvm:3.5.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=false, dexing-min-sdk=21, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}.
      > Execution failed for DexingWithClasspathTransform: /home/expo/.gradle/caches/transforms-3/b0f370bc1d102b66d805026175b637a5/transformed/jetified-okio-jvm-3.5.0.jar.
         > Error while dexing.
   > Failed to transform kotlin-stdlib-1.9.0.jar (org.jetbrains.kotlin:kotlin-stdlib:1.9.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=false, dexing-min-sdk=21, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: /home/expo/.gradle/caches/transforms-3/bf77976bd92b913382d76ece3b457a9e/transformed/jetified-kotlin-stdlib-1.9.0.jar.
         > Error while dexing.
* 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 10m 7s

Versions:

`eas-cli/5.4.0`
`darwin-arm64`
`node-v20.7.0`
`npx 10.1.0`
`expo-doctor 1.1.3`

"@apollo/client": "^3.8.5",
    "@expo/config-plugins": "^7.2.5",
    "@expo/metro-config": "^0.10.7",
    "@expo/vector-icons": "^13.0.0",
    "@hookstate/core": "^4.0.1",
    "@react-native-async-storage/async-storage": "1.18.2",
    "@react-native-community/netinfo": "9.3.10",
    "@react-native-community/slider": "4.4.2",
    "@react-navigation/bottom-tabs": "^6.5.9",
    "@react-navigation/native": "^6.1.8",
    "@react-navigation/native-stack": "^6.9.14",
    "@react-navigation/stack": "^6.3.18",
    "@rneui/base": "^4.0.0-rc.7",
    "@rneui/themed": "^4.0.0-rc.7",
    "@sentry/react-native": "5.5.0",
    "apollo3-cache-persist": "^0.14.1",
    "axios": "^1.3.5",
    "babel-preset-expo": "^9.5.2",
    "expo": "^49.0.13",
    "expo-application": "~5.3.0",
    "expo-asset": "~8.10.1",
    "expo-build-properties": "~0.8.3",
    "expo-camera": "~13.4.4",
    "expo-checkbox": "~2.4.0",
    "expo-constants": "~14.4.2",
    "expo-dev-client": "~2.4.11",
    "expo-device": "~5.4.0",
    "expo-file-system": "~15.4.4",
    "expo-image-manipulator": "~11.3.0",
    "expo-image-picker": "~14.3.2",
    "expo-localization": "~14.3.0",
    "expo-media-library": "~15.4.1",
    "expo-navigation-bar": "~2.3.0",
    "expo-print": "~12.4.2",
    "expo-sharing": "~11.5.0",
    "expo-splash-screen": "~0.20.5",
    "expo-status-bar": "~1.6.0",
    "expo-system-ui": "~2.4.0",
    "expo-updates": "~0.18.16",
    "graphql": "^16.8.1",
    "graphql-tag": "^2.12.6",
    "hyphenation.de": "^0.2.1",
    "hyphenation.en-us": "^0.2.1",
    "hypher": "^0.2.5",
    "i18n-js": "^4.3.0",
    "intl": "^1.2.5",
    "jwt-decode": "^3.1.2",
    "lottie-react-native": "5.1.6",
    "moment": "^2.29.4",
    "qs": "^6.11.2",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-intl": "^6.4.7",
    "react-native": "^0.72.5",
    "react-native-auth0": "^3.0.1",
    "react-native-chart-kit": "^6.12.0",
    "react-native-date-picker": "^4.3.3",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-markdown-package": "^1.8.2",
    "react-native-paper": "^5.10.6",
    "react-native-purchases": "^6.6.0",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "~3.22.0",
    "react-native-swipe-gestures": "^1.0.5",
    "react-native-video": "^5.2.1",
    "react-native-webview": "13.2.2",
    "run-ios": "^0.4.0",
    "sentry-expo": "^7.0.1",
    "styled-components": "^5.3.11"

What have I tried?

  • rm -rf node_modules and npm I
  • npx expo-doctor: Didn't find any issues with the project!
  • eas build --cache-clear
  • npm cache clean --force
  • checked dependencies versions
  • npx expo install --fix : `dependencies are up to date"

Has anyone encountered the same error? How did you solve it?
Thank you!

I also tried to overwrite the Kotlin version at app.json

     [
        "expo-build-properties",
        {
          "android": {
            "compileSdkVersion": 34,
            "targetSdkVersion": 33,
            "kotlinVersion": "1.8.10"
          },
          "ios": {
            "deploymentTarget": "13.0"
          }
        }
      ],

Didn’t work as well :confused:

you have a bunch of libraries that we don’t validate the versions of, so you might want to look at those - eg: react-native-markdown-package, react-native-swipe-gestures, react-native-video. it’s hard to give more concrete advice with your full logs. i suspect react-native-video is the likely culprit.

I’ve changed the react-native-video dependency to expo-av and the issue is still there. Changing the dependencies at this point, unfortunately is not a possible solution for us.

hey there. you’ll need to figure out which of your dependencies is causing this issue. this may be a good approach: https://expo.fyi/manual-debugging

Start by uninstalling these.

Also, if you are referencing @expo/metro-config in metro.config.js, you should change that to use expo/metro-config as shown on this page: Metro bundler - Expo Documentation

No need for this. It’s handled by @babel/core and the following babel.config.js:

module.exports = function(api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
  };
};

Are you using this? If not, uninstall it. I am not familiar with it. If you need it, at least move it to devDependencies.

Also double check if there are any other dependencies that you are not actually using and are not required by other dependencies. e.g. React Navigation requires react-native-safe-area-context and react-native-screens and the stack navigator requires react-native-gesture-handler.

e.g. are you using both the stack navigator and the native stack navigator? Maybe uninstall the one you’re not using. This is probably not the cause of your problem, but it’s usually best to uninstall what you aren’t using.

I believe Brent meant to say *without your full logs.

The build errors are most likely caused by some sort of conflict between some of your dependencies. You first need to find out which ones are conflicting. Once you know that, you can perhaps contact the authors of that/those dependency/ies to figure out a solution. It will also give you a way to ask questions that are more likely to get useful answers.

The way I have done this sort of thing in the past is by basically doing a bisection search on the dependencies. i.e. remove half of them and see if the error goes away. If so, the problem is most likely in the other half. This is the sort of thing that Brent’s manual debugging link is about.

FYI, I created a new app, installed all of your dependencies from your initial post, added the following config plugin:

    "plugins": [
      [
        "react-native-auth0",
        {
          "domain": "{DOMAIN}"
        }
      ]
    ],

and tried building the app locally:

$ export JAVA_VERSION=11
$ eas build -p android --profile preview --local

and it worked for me.

[...]
Build successful
You can find the build artifacts in /tmp/deps/build-1697307019954.apk

It could be that you have an android directory and something in there is causing problems. If you do have an android directory, try moving it out of the way and see if you can build the app.

Thank you @brents and @wodin for the replies, I’ve tried to debug and check each dependency. When I tried to build the app locally I am getting the error bellow:

[PREBUILD] yarn run v1.22.19
[PREBUILD] $ /private/var/folders/c4/qtn2lcgn2ml5f4vkt94v90_w0000gn/T/eas-build-local-nodejs/980f0c86-9040-4b47-a4be-5d3bb3ac0714/build/node_modules/.bin/expo prebuild --no-install --platform android
[PREBUILD] The android project is malformed, project files will be cleared and reinitialized.
[PREBUILD] - Clearing android
[PREBUILD] ✔ Cleared android code
[PREBUILD] - Creating native project directories (./ios and ./android) and updating .gitignore
[PREBUILD] ✔ Created native project | gitignore skipped
[PREBUILD] - Updating your package.json scripts, dependencies, and main file
[PREBUILD] ✔ Updated package.json and added index.js entry point for iOS and Android
[PREBUILD] - Config syncing
[PREBUILD] Using node to generate images. This is much slower than using native packages.
[PREBUILD] › Optionally you can stop the process and try again after successfully running `npm install -g sharp-cli`.
[PREBUILD] - Config syncing
[PREBUILD] ✔ Config synced
[PREBUILD] Done in 2.50s.
[PREBUILD] Running "yarn install" in /var/folders/c4/qtn2lcgn2ml5f4vkt94v90_w0000gn/T/eas-build-local-nodejs/980f0c86-9040-4b47-a4be-5d3bb3ac0714/build directory
[PREBUILD] yarn install v1.22.19
[PREBUILD] [1/4] Resolving packages...
[PREBUILD] success Already up-to-date.
[PREBUILD] Done in 0.15s.
[PREPARE_CREDENTIALS] Writing secrets to the project's directory
[PREPARE_CREDENTIALS] Injecting signing config into build.gradle
[CONFIGURE_EXPO_UPDATES] Setting the update request headers in 'AndroidManifest.xml' to '{"expo-channel-name":"staging"}'
[RUN_GRADLEW] Running 'gradlew :app:assembleRelease' in /var/folders/c4/qtn2lcgn2ml5f4vkt94v90_w0000gn/T/eas-build-local-nodejs/980f0c86-9040-4b47-a4be-5d3bb3ac0714/build/android
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:pluginDescriptors
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:processResources
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:pluginDescriptors
[RUN_GRADLEW] > Task :gradle-plugin:pluginDescriptors
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:processResources
[RUN_GRADLEW] > Task :gradle-plugin:processResources
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:compileKotlin
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:compileJava NO-SOURCE
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:classes
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:jar
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:inspectClassesForKotlinIC
[RUN_GRADLEW] > Task :gradle-plugin:compileKotlin
[RUN_GRADLEW] > Task :gradle-plugin:compileJava NO-SOURCE
[RUN_GRADLEW] > Task :gradle-plugin:classes
[RUN_GRADLEW] > Task :gradle-plugin:jar
[RUN_GRADLEW] > Task :gradle-plugin:inspectClassesForKotlinIC
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:compileKotlin
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:compileJava NO-SOURCE
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:classes
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:jar
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:inspectClassesForKotlinIC
[RUN_GRADLEW] > Configure project :app
[RUN_GRADLEW]  ℹ️  Applying gradle plugin 'expo-dev-launcher-gradle-plugin' (expo-dev-launcher@2.4.13)
[RUN_GRADLEW]  ℹ️  Applying gradle plugin 'expo-updates-gradle-plugin' (expo-updates@0.18.16)
[RUN_GRADLEW] FAILURE: Build completed with 2 failures.
[RUN_GRADLEW] 1: Task failed with an exception.
[RUN_GRADLEW] -----------
[RUN_GRADLEW] * Where:
[RUN_GRADLEW] Script '/private/var/folders/c4/qtn2lcgn2ml5f4vkt94v90_w0000gn/T/eas-build-local-nodejs/980f0c86-9040-4b47-a4be-5d3bb3ac0714/build/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle' line: 356
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] A problem occurred evaluating project ':expo'.
[RUN_GRADLEW] > A problem occurred configuring project ':expo-av'.
[RUN_GRADLEW]    > Failed to notify project evaluation listener.
[RUN_GRADLEW]       > com.android.builder.errors.EvalIssueException: SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at '/private/var/folders/c4/qtn2lcgn2ml5f4vkt94v90_w0000gn/T/eas-build-local-nodejs/980f0c86-9040-4b47-a4be-5d3bb3ac0714/build/android/local.properties'.
[RUN_GRADLEW]       > Could not get unknown property 'release' for SoftwareComponentInternal set of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] > Run with --info or --debug option to get more log output.
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] ==============================================================================
[RUN_GRADLEW] 2: Task failed with an exception.
[RUN_GRADLEW] -----------
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] A problem occurred configuring project ':expo'.
[RUN_GRADLEW] > com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] > Run with --info or --debug option to get more log output.
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] ==============================================================================
[RUN_GRADLEW] * Get more help at https://help.gradle.org
[RUN_GRADLEW] BUILD FAILED in 11s

If I’m interpreting this correctly, you do have an android directory, but for some reason, npx expo prebuild didn’t like it and regenerated it.

“Define a valid SDK location with an ANDROID_HOME environment variable”

It looks like it can’t find your Android SDK. See the following page and define the ANDROID_HOME environment variable to point to where you have it installed.

Hi @wodin, thank you for your fast reply.

I really don’t understand why this errors are occurring and are blocking the App release.

I also tried to start a fresh project, but I am running through the same errors.

I reinstalled the expo-av and had no changes

When I run eas build -p android --profile preview --local (with the java versions 11 and 17) I get the error logs bellow:

[RUN_EXPO_DOCTOR] Running "expo doctor"
[RUN_EXPO_DOCTOR] Running 10 checks on your project...
[RUN_EXPO_DOCTOR] ✔ Check Expo config for common issues
[RUN_EXPO_DOCTOR] ✔ Check package.json for common issues
[RUN_EXPO_DOCTOR] ✔ Check dependencies for packages that should not be installed directly
[RUN_EXPO_DOCTOR] ✔ Check for common project setup issues
[RUN_EXPO_DOCTOR] ✔ Check npm/ yarn versions
[RUN_EXPO_DOCTOR] ✔ Check Expo config (app.json/ app.config.js) schema
[RUN_EXPO_DOCTOR] ✔ Check for legacy global CLI installed locally
[RUN_EXPO_DOCTOR] ✔ Check that native modules do not use incompatible support packages
[RUN_EXPO_DOCTOR] ✔ Check that packages match versions required by installed Expo SDK
[RUN_EXPO_DOCTOR] ✔ Check that native modules use compatible support package versions for installed Expo SDK
[RUN_EXPO_DOCTOR] Didn't find any issues with the project!
[PREBUILD] yarn run v1.22.19
[PREBUILD] $ /private/var/folders/c4/qtn2lcgn2ml5f4vkt94v90_w0000gn/T/eas-build-local-nodejs/e2370f4f-688b-4013-a02e-9111d58e0e12/build/node_modules/.bin/expo prebuild --no-install --platform android
[PREBUILD] - Creating native project directories (./ios and ./android) and updating .gitignore
[PREBUILD] ✔ Created native project | gitignore skipped
[PREBUILD] - Updating your package.json scripts, dependencies, and main file
[PREBUILD] ✔ Updated package.json and added index.js entry point for iOS and Android
[PREBUILD] - Config syncing
[PREBUILD] Using node to generate images. This is much slower than using native packages.
[PREBUILD] › Optionally you can stop the process and try again after successfully running `npm install -g sharp-cli`.
[PREBUILD] - Config syncing
[PREBUILD] ✔ Config synced
[PREBUILD] Done in 2.50s.
[PREBUILD] Running "yarn install" in /var/folders/c4/qtn2lcgn2ml5f4vkt94v90_w0000gn/T/eas-build-local-nodejs/e2370f4f-688b-4013-a02e-9111d58e0e12/build directory
[PREBUILD] yarn install v1.22.19
[PREBUILD] [1/4] Resolving packages...
[PREBUILD] success Already up-to-date.
[PREBUILD] Done in 0.15s.
[PREPARE_CREDENTIALS] Writing secrets to the project's directory
[PREPARE_CREDENTIALS] Injecting signing config into build.gradle
[CONFIGURE_EXPO_UPDATES] Setting the update request headers in 'AndroidManifest.xml' to '{"expo-channel-name":"staging"}'
[RUN_GRADLEW] Running 'gradlew :app:assembleRelease' in /var/folders/c4/qtn2lcgn2ml5f4vkt94v90_w0000gn/T/eas-build-local-nodejs/e2370f4f-688b-4013-a02e-9111d58e0e12/build/android
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:pluginDescriptors
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:processResources
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:pluginDescriptors
[RUN_GRADLEW] > Task :gradle-plugin:pluginDescriptors
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:processResources
[RUN_GRADLEW] > Task :gradle-plugin:processResources
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:compileKotlin
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:compileJava NO-SOURCE
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:classes
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:jar
[RUN_GRADLEW] > Task :expo-dev-launcher-gradle-plugin:inspectClassesForKotlinIC
[RUN_GRADLEW] > Task :gradle-plugin:compileKotlin
[RUN_GRADLEW] > Task :gradle-plugin:compileJava NO-SOURCE
[RUN_GRADLEW] > Task :gradle-plugin:classes
[RUN_GRADLEW] > Task :gradle-plugin:jar
[RUN_GRADLEW] > Task :gradle-plugin:inspectClassesForKotlinIC
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:compileKotlin
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:compileJava NO-SOURCE
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:classes
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:jar
[RUN_GRADLEW] > Task :expo-updates-gradle-plugin:inspectClassesForKotlinIC
[RUN_GRADLEW] > Configure project :app
[RUN_GRADLEW]  ℹ️  Applying gradle plugin 'expo-dev-launcher-gradle-plugin' (expo-dev-launcher@2.4.13)
[RUN_GRADLEW] ℹ️  Applying gradle plugin 'expo-updates-gradle-plugin' (expo-updates@0.18.16)
[RUN_GRADLEW] FAILURE: Build completed with 2 failures.
[RUN_GRADLEW] 1: Task failed with an exception.
[RUN_GRADLEW] -----------
[RUN_GRADLEW] * Where:
[RUN_GRADLEW] Script '/private/var/folders/c4/qtn2lcgn2ml5f4vkt94v90_w0000gn/T/eas-build-local-nodejs/e2370f4f-688b-4013-a02e-9111d58e0e12/build/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle' line: 356
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] A problem occurred evaluating project ':expo'.
[RUN_GRADLEW] > A problem occurred configuring project ':expo-av'.
[RUN_GRADLEW]    > Failed to notify project evaluation listener.
[RUN_GRADLEW]       > com.android.builder.errors.EvalIssueException: SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at '/private/var/folders/c4/qtn2lcgn2ml5f4vkt94v90_w0000gn/T/eas-build-local-nodejs/e2370f4f-688b-4013-a02e-9111d58e0e12/build/android/local.properties'.
[RUN_GRADLEW]       > Could not get unknown property 'release' for SoftwareComponentInternal set of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] > Run with --info or --debug option to get more log output.
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] ==============================================================================
[RUN_GRADLEW] 2: Task failed with an exception.
[RUN_GRADLEW] -----------
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] A problem occurred configuring project ':expo'.
[RUN_GRADLEW] > com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] > Run with --info or --debug option to get more log output.
[RUN_GRADLEW] > Run with --scan
[RUN_GRADLEW] to get full insights.
[RUN_GRADLEW] ==============================================================================
[RUN_GRADLEW] * Get more help at
[RUN_GRADLEW] https://help.gradle.org
[RUN_GRADLEW] BUILD FAILED in 10s
[RUN_GRADLEW] 15 actionable tasks: 15 executed
[RUN_GRADLEW] Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

Build failed
Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
npx exited with non-zero code: 1

There was no android folder, I made sure to delete it before starting the build and the emulator was running.

Running eas build --clear-cache I get the error logs bellow:

> Task :expo-modules-core:mergeReleaseJniLibFolders
> Task :expo-modules-core:mergeReleaseNativeLibs
> Task :expo-modules-core:copyReleaseJniLibsProjectOnly
> Task :expo-av:externalNativeBuildRelease
> Task :expo-av:mergeReleaseNativeLibs
> Task :expo-av:copyReleaseJniLibsProjectOnly
> Task :expo-modules-core:prepareReleaseArtProfile
> Task :expo:compileReleaseJavaWithJavac
> Task :expo:bundleLibCompileToJarRelease
> Task :expo:bundleLibRuntimeToJarRelease
> Task :expo:bundleLibResRelease
> Task :app:mergeExtDexRelease FAILED
> Task :app:createBundleReleaseJsAndAssets_SentryUploadCleanUp SKIPPED
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeExtDexRelease'.
> Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
   > Failed to transform okio-jvm-3.5.0.jar (com.squareup.okio:okio-jvm:3.5.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=false, dexing-min-sdk=21, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}.
      > Execution failed for DexingWithClasspathTransform: /home/expo/.gradle/caches/transforms-3/b0f370bc1d102b66d805026175b637a5/transformed/jetified-okio-jvm-3.5.0.jar.
         > Error while dexing.
   > Failed to transform kotlin-stdlib-1.9.0.jar (org.jetbrains.kotlin:kotlin-stdlib:1.9.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=false, dexing-min-sdk=21, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: /home/expo/.gradle/caches/transforms-3/bf77976bd92b913382d76ece3b457a9e/transformed/jetified-kotlin-stdlib-1.9.0.jar.
         > Error while dexing.
* 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 9m 37s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/8.0.1/userguide/command_line_interface.html#sec:command_line_warnings
893 actionable tasks: 893 executed
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

I made required changes and deleted the dependencies

"@expo/config-plugins": "^7.2.5",
"@expo/metro-config": "^0.10.7",
"babel-preset-expo": "^9.5.2, 
"run-ios": "^0.4.0",

Here is the updated package.json

 "scripts": {
    "start": "expo start",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "eject": "expo eject",
    "test": "jest"
  },
  "dependencies": {
    "@apollo/client": "^3.8.5",
    "@expo/vector-icons": "^13.0.0",
    "@hookstate/core": "^4.0.1",
    "@react-native-async-storage/async-storage": "1.18.2",
    "@react-native-community/netinfo": "9.3.10",
    "@react-native-community/slider": "4.4.2",
    "@react-navigation/bottom-tabs": "^6.5.9",
    "@react-navigation/native": "^6.1.8",
    "@react-navigation/native-stack": "^6.9.14",
    "@react-navigation/stack": "^6.3.18",
    "@sentry/react-native": "5.5.0",
    "apollo3-cache-persist": "^0.14.1",
    "axios": "^1.3.5",
    "expo": "^49.0.13",
    "expo-application": "~5.3.0",
    "expo-asset": "~8.10.1",
    "expo-av": "~13.4.1",
    "expo-build-properties": "~0.8.3",
    "expo-camera": "~13.4.4",
    "expo-checkbox": "~2.4.0",
    "expo-constants": "~14.4.2",
    "expo-dev-client": "~2.4.11",
    "expo-device": "~5.4.0",
    "expo-file-system": "~15.4.4",
    "expo-image-manipulator": "~11.3.0",
    "expo-image-picker": "~14.3.2",
    "expo-localization": "~14.3.0",
    "expo-media-library": "~15.4.1",
    "expo-navigation-bar": "~2.3.0",
    "expo-print": "~12.4.2",
    "expo-sharing": "~11.5.0",
    "expo-splash-screen": "~0.20.5",
    "expo-status-bar": "~1.6.0",
    "expo-system-ui": "~2.4.0",
    "expo-updates": "^0.18.16",
    "graphql": "^16.8.1",
    "graphql-tag": "^2.12.6",
    "hyphenation.de": "^0.2.1",
    "hyphenation.en-us": "^0.2.1",
    "hypher": "^0.2.5",
    "i18n-js": "^4.2.0",
    "intl": "^1.2.5",
    "lottie-react-native": "5.1.6",
    "moment": "^2.29.4",
    "posthog-react-native": "^2.8.1",
    "qs": "^6.11.2",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-intl": "^6.4.7",
    "react-native": "0.72.5",
    "react-native-auth0": "^3.0.1",
    "react-native-chart-kit": "^6.12.0",
    "react-native-date-picker": "^4.3.3",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-markdown-package": "^1.8.2",
    "react-native-paper": "^5.10.6",
    "react-native-purchases": "^6.6.0",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "~3.22.0",
    "react-native-swipe-gestures": "^1.0.5",
    "react-native-webview": "13.2.2",
    "sentry-expo": "^7.0.1",
    "styled-components": "^5.3.11"
  },
  "devDependencies": {
    "@babel/core": "^7.23.0",
    "@testing-library/react-native": "^12.2.2",
    "babel-plugin-import-graphql": "^2.8.1",
    "babel-plugin-transform-remove-console": "^6.9.4",
    "jest": "^29.7.0",
    "jest-expo": "^49.0.0"
  },
  "jest": {
    "preset": "jest-expo",
    "transformIgnorePatterns": [
      "node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)"
    ],
    "collectCoverage": false
  },
  "private": true
}

babel.config.js

module.exports = (api) => {
  const babelEnv = api.env();
  api.cache(true);
  const plugins = ["import-graphql"];
  if (babelEnv !== "development") {
    plugins.push(["transform-remove-console", { exclude: ["error", "warn"] }]);
  }
  return {
    presets: ["babel-preset-expo"],
    plugins,
  };
};

app.json

  [
        "expo-build-properties",
        {
          "android": {
            "compileSdkVersion": 34,
            "targetSdkVersion": 33,
            "kotlinVersion": "1.8.10"
          },
          "ios": {
            "deploymentTarget": "13.0"
          }
        }
      ],

Try creating a new app and adding those dependencies and the bare minimum “plugins” options needed (presumably just the react-native-auth0 domain stuff.)

Leave the default App.js.

Try to build that on Expo’s servers with eas build -p android --profile preview

If that works, you could try building with --local. If it works on Expo’s servers, but not locally, then you can investigate that.

If it does not work on the server (it did work locally for me, so it should work for you using Expo’s build servers), then post the errors here and also a link to the build page (in case one of the Expo team members is able to have a look. I don’t work for Expo, so don’t have access to your build logs.)

If you get it to build (and again, I think at least building a new app on the Expo build servers should work), then you can try adding the JavaScript from the real app.

Hopefully the above will give you more info to troubleshoot what’s going wrong in the real app.

Hi @wodin! Thank you so much for your help :slight_smile: I managed to do a build and the issue was overriding the versions at app.json. I deleted the lines bellow.

  "compileSdkVersion": 34,
    "targetSdkVersion": 33,
      "kotlinVersion": "1.8.10"
1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.