EAS build (Managed) fails with error: Execution failed for task ':app:mergeDexRelease'.

Running eas build --platform android in my managed app outputs the error:

Execution failed for task ':app:mergeDexRelease'.
[stderr] > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade

Why am I getting this error with eas build and how can I fix it? Thanks you for your help as I’m stuck here for the past 2 days

expo diagnostics:

Expo CLI 4.4.7 environment info:
    System:
      OS: macOS 11.4
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 12.22.1 - ~/.nvm/versions/node/v12.22.1/bin/node
      Yarn: 1.22.10 - ~/.nvm/versions/node/v12.22.1/bin/yarn
      npm: 6.14.12 - ~/.nvm/versions/node/v12.22.1/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.10.1 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
    IDEs:
      Android Studio: 4.1 AI-201.8743.12.41.7042882
      Xcode: 12.5/12E262 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~41.0.1 => 41.0.1 
      react: 16.13.1 => 16.13.1 
      react-dom: 16.13.1 => 16.13.1 
      react-native: https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz => 0.63.2 
      react-native-web: ~0.13.12 => 0.13.18 
    npmGlobalPackages:
      expo-cli: 4.4.7
    Expo Workflow: managed

/build/workingdir/build/node_modules/@react-native-community/viewpager/android/build/.transforms/bbe5e21b6cb44ead34fcd890a1437bc9/transformed/classes/classes.dex: D8: Type com.reactnativecommunity.viewpager.BuildConfig is defined multiple times: /build/workingdir/build/node_modules/@react-native-community/viewpager/android/build/.transforms/bbe5e21b6cb44ead34fcd890a1437bc9/transformed/classes/classes.dex, /build/workingdir/build/node_modules/react-native-pager-view/android/build/.transforms/8f96c17d02b6785fab037261c567cf6b/transformed/classes/classes.dex

that error means that package com.reactnativecommunity.viewpager is loaded twice, once in @react-native-community/viewpager and once in react-native-pager-view. Either you added them as dependencies, or they are dependencies of some of the other packages you are using

1 Like

Thank you for help. I remove the above mentioned dependencies which were not used anyway and the build worked

1 Like

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