EAS could not build android app

Please provide the following:

  1. expo-cli 5.4.3
  2. expo: “^45.0.3”
  3. Platform: android

Hi, I had an error while building my android app. I’m using google play console. But the error below always appear. Someone here have an idea how to fix this issue, I’ll be appreciate.

[stderr] Note: /home/expo/workingdir/build/node_modules/@react-native-community/checkbox/android/src/main/java/com/reactnativecommunity/checkbox/ReactCheckBoxEvent.java uses or overrides a deprecated API.
[stderr] Note: /home/expo/workingdir/build/node_modules/expo-notifications/android/src/main/java/expo/modules/notifications/notifications/presentation/builders/ExpoNotificationBuilder.java uses or overrides a deprecated API.
[stderr] Note: /home/expo/workingdir/build/node_modules/@react-native-clipboard/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java uses or overrides a deprecated API.
[stderr] Note: /home/expo/workingdir/build/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java uses or overrides a deprecated API.

Hi @energitech

Those are not errors. They are just warnings and you can ignore them.

If your app failed to build there should be an error close to the end of the “Run gradlew” log. Also check the “Run expo doctor” log to see if it complains about anything.

Thank you for your reply. I run doctor and I had no error here is the msg :tada: Didn’t find any issues with the project! but the build doesn’t success I got this in the log : :robot: Android build failed:
Gradle build failed with unknown error. Please see logs for the “Run gradlew” phase.

Please post the last several lines of the “Run gradlew” logs. For example, here’s one of my failed builds:

> Configure project :react-native-reanimated

AAR for react-native-reanimated has been found

/home/expo/workingdir/build/node_modules/react-native-reanimated/android/react-native-reanimated-68-jsc.aar

[stderr] FAILURE: Build failed with an exception.

[stderr] * What went wrong:

[stderr] Could not determine the dependencies of task ':app:mergeReleaseNativeLibs'.

[stderr] > Could not resolve all task dependencies for configuration ':app:releaseRuntimeClasspath'.

[stderr]    > Could not find any matches for app.notifee:core:+ as no versions of app.notifee:core are available.

[stderr]      Searched in the following locations:

[stderr]        - http://maven-cache-service.production.svc.cluster.local:8081/artifactory/libs-release/app/notifee/core/maven-metadata.xml

[stderr]        - file:/home/expo/.m2/repository/app/notifee/core/

[stderr]        - file:/home/expo/workingdir/build/node_modules/react-native/android/app/notifee/core/maven-metadata.xml

[stderr]        - file:/home/expo/workingdir/build/node_modules/jsc-android/dist/app/notifee/core/maven-metadata.xml

[stderr]        - https://dl.google.com/dl/android/maven2/app/notifee/core/maven-metadata.xml

[stderr]        - https://repo.maven.apache.org/maven2/app/notifee/core/maven-metadata.xml

[stderr]        - https://www.jitpack.io/app/notifee/core/maven-metadata.xml

[stderr]      Required by:

[stderr]          project :app > project :notifee_react-native

[stderr] * Try:

[stderr] > Run with --stacktrace option to get the stack trace.

[stderr] > Run with --info or --debug option to get more log output.

[stderr] > Run with --scan to get full insights.

[stderr] * Get more help at https://help.gradle.org

[stderr] BUILD FAILED in 3m 16s

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.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/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings

6 actionable tasks: 6 executed

Unable to list file systems to check whether they can be watched. The whole state of the virtual file system has been discarded. Reason: Could not query file systems: could not open mount file (errno 2: No such file or directory)

Error: Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase.

Also, while you’re at it, please post your dependencies and devDependencies from package.json.

Sorry, I don’t have access to that page. Only you and members of the Expo team would be able to see it.

Okay so here is the latest lines in Run gradlew:
[stderr]

	at com.android.tools.r8.dex.a.a(SourceFile:23)

1296[stderr]

	at com.android.tools.r8.D8.a(D8.java:21)

1297[stderr]

	at com.android.tools.r8.D8.d(D8.java:11)

1298[stderr]

	at com.android.tools.r8.D8.b(D8.java:1)

1299[stderr]

	at com.android.tools.r8.utils.w.a(SourceFile:24)

1300[stderr]

	... 36 more

1301[stderr]

FAILURE: Build failed with an exception.

1302[stderr]

* What went wrong:

1303[stderr]

Execution failed for task ':app:mergeDexRelease'.

1304[stderr]

> A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingTaskDelegate

1305[stderr]

   > There was a failure while executing work items

1306[stderr]

      > A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingWorkAction

1307[stderr]

         > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 

1308[stderr]

           Type com.reactnativecommunity.clipboard.BuildConfig is defined multiple times: /home/expo/workingdir/build/node_modules/@react-native-clipboard/clipboard/android/build/.transforms/4a06407f98ef68764ce80557dc85fc90/transformed/classes/classes.dex, /home/expo/workingdir/build/node_modules/@react-native-community/clipboard/android/build/.transforms/7db7fdc328a68f202881fc78e4f15395/transformed/classes/classes.dex

1309[stderr]

           Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.

1310[stderr]

* Try:

1311[stderr]

> Run with --stacktrace option to get the stack trace.

1312[stderr]

> Run with --info or --debug option to get more log output.

1313[stderr]

> Run with --scan to get full insights.

1314[stderr]

* Get more help at https://help.gradle.org

1315[stderr]

BUILD FAILED in 11m 45s

1316

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

1317

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

1318

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings

1319

Execution optimizations have been disabled for 7 invalid unit(s) of work during this build to ensure correctness.

1320

Please consult deprecation warnings for more details.

1321

600 actionable tasks: 600 executed

1322

Unable to list file systems to check whether they can be watched. The whole state of the virtual file system has been discarded. Reason: Could not query file systems: could not open mount file (errno 2: No such file or directory)

1323

Error: Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase.

That is more promising. Now please get more of that, from before the start of the stack trace.

i.e. this is from the middle of a stack trace:

[stderr]
	at com.android.tools.r8.dex.a.a(SourceFile:23)
1296[stderr]
	at com.android.tools.r8.D8.a(D8.java:21)

I would need to see from before the start of it.

It will probably say something about “fatal” or “Exception” at the start.

Also, as I said in an earlier message:

1 Like

OKay



40[stderr]

Note: /home/expo/workingdir/build/node_modules/react-native-gradle-plugin/src/main/java/com/facebook/react/codegen/generator/SchemaJsonParser.java uses or overrides a deprecated API.

41[stderr]


Note: Recompile with -Xlint:deprecation for details.


42


> Task :react-native-gradle-plugin:pluginDescriptors


43


> Task :react-native-gradle-plugin:processResources


44

> Task :react-native-gradle-plugin:classes


45

> Task :react-native-gradle-plugin:inspectClassesForKotlinIC


46

> Task :react-native-gradle-plugin:jar

47

> Configure project :app

[stderr]

com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 


1239[stderr]

Type com.reactnativecommunity.clipboard.BuildConfig is defined multiple times: /home/expo/workingdir/build/node_modules/@react-native-clipboard/clipboard/android/build/.transforms/4a06407f98ef68764ce80557dc85fc90/transformed/classes/classes.dex, /home/expo/workingdir/build/node_modules/@react-native-community/clipboard/android/build/.transforms/7db7fdc328a68f202881fc78e4f15395/transformed/classes/classes.dex


1240[stderr]

Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.


1241[stderr]
	at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:151)


1242[stderr]

	at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:138)

1243[stderr]

	at com.android.build.gradle.internal.tasks.DexMergingWorkAction.merge(DexMergingTask.kt:863)


1244[stderr]


	at com.android.build.gradle.internal.tasks.DexMergingWorkAction.run(DexMergingTask.kt:809)


1245[stderr]


	at com.android.build.gradle.internal.profile.ProfileAwareWorkAction.execute(ProfileAwareWorkAction.kt:74)


1246[stderr]
	at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)

[stderr]


FAILURE: Build failed with an exception.


1302[stderr]

* What went wrong:


1303[stderr]

Execution failed for task ':app:mergeDexRelease'.


1304[stderr]

> A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingTaskDelegate

1305[stderr]


   > There was a failure while executing work items


1306[stderr]

      > A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingWorkAction

1307[stderr]

         > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 

1308[stderr]

           Type com.reactnativecommunity.clipboard.BuildConfig is defined multiple times: /home/expo/workingdir/build/node_modules/@react-native-clipboard/clipboard/android/build/.transforms/4a06407f98ef68764ce80557dc85fc90/transformed/classes/classes.dex, /home/expo/workingdir/build/node_modules/@react-native-community/clipboard/android/build/.transforms/7db7fdc328a68f202881fc78e4f15395/transformed/classes/classes.dex

for package.json :

"dependencies": {
    "@expo/vector-icons": "^13.0.0",
    "@fortawesome/fontawesome-svg-core": "^1.2.36",
    "@fortawesome/free-solid-svg-icons": "^5.15.4",
    "@fortawesome/react-native-fontawesome": "^0.2.7",
    "@material-ui/core": "^4.12.3",
    "@material-ui/icons": "^4.11.2",
    "@miblanchard/react-native-slider": "^2.1.0",
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-clipboard/clipboard": "^1.10.0",
    "@react-native-community/art": "^1.2.0",
    "@react-native-community/checkbox": "^0.5.12",
    "@react-native-community/clipboard": "^1.5.1",
    "@react-native-community/datetimepicker": "6.1.2",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-picker/picker": "2.4.0",
    "@react-navigation/bottom-tabs": "^6.1.0",
    "@react-navigation/drawer": "^6.1.6",
    "@react-navigation/material-top-tabs": "^6.2.1",
    "@react-navigation/native": "^6.0.4",
    "@react-navigation/native-stack": "^6.2.2",
    "@react-navigation/stack": "^6.0.9",
    "@twotalltotems/react-native-otp-input": "^1.3.11",
    "antd": "^4.17.2",
    "axios": "^0.23.0",
    "buffer": "^6.0.3",
    "expo": "^45.0.3",
    "expo-checkbox": "~2.1.0",
    "expo-clipboard": "~3.0.1",
    "expo-constants": "~13.1.1",
    "expo-linear-gradient": "~11.3.0",
    "expo-notifications": "~0.15.2",
    "expo-permissions": "~13.2.0",
    "expo-sms": "~10.2.0",
    "expo-splash-screen": "~0.15.1",
    "expo-status-bar": "~1.3.0",
    "expo-updates": "~0.13.2",
    "material-ui": "^1.0.0-beta.47",
    "mqtt": "^4.2.8",
    "native-base": "^3.2.1",
    "pod-install": "^0.1.32",
    "react": "17.0.2",
    "react-chartjs-2": "^3.3.0",
    "react-dom": "17.0.2",
    "react-minimal-pie-chart": "^8.3.0",
    "react-native": "0.68.2",
    "react-native-axios": "^0.17.1",
    "react-native-button": "^3.0.1",
    "react-native-cardview": "^2.0.5",
    "react-native-chart-kit": "^6.11.0",
    "react-native-dotenv": "^3.3.1",
    "react-native-elements": "^3.4.2",
    "react-native-expo-pie-chart": "^1.0.0",
    "react-native-fontawesome": "^7.0.0",
    "react-native-gesture-handler": "~2.2.1",
    "react-native-indicator": "^1.2.2",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-material-design": "^0.3.7",
    "react-native-pager-view": "5.4.15",
    "react-native-paho-mqtt": "^0.1.1",
    "react-native-paper": "^4.9.2",
    "react-native-phone-number-input": "^2.1.0",
    "react-native-pie": "^1.1.2",
    "react-native-pie-chart": "^2.0.2",
    "react-native-progress": "^5.0.0",
    "react-native-pure-chart": "^0.0.24",
    "react-native-reanimated": "~2.8.0",
    "react-native-responsive-linechart": "^5.7.1",
    "react-native-safe-area-context": "4.2.4",
    "react-native-safe-area-view": "^1.1.1",
    "react-native-splash-screen": "^3.2.0",
    "react-native-status-bar-height": "^2.6.0",
    "react-native-super-grid": "^4.1.3",
    "react-native-svg": "12.3.0",
    "react-native-svg-charts": "^5.4.0",
    "react-native-switch-selector": "^2.1.4",
    "react-native-tab-view": "^3.1.1",
    "react-native-uuid": "^2.0.1",
    "react-native-vector-icons": "^8.1.0",
    "react-native-volume-slider": "^0.5.1",
    "react-native-web": "0.17.7",
    "react-navigation": "^4.4.4",
    "react-navigation-animated-switch": "^0.6.4",
    "react-navigation-stack": "^2.10.4",
    "react_native_mqtt": "^1.3.1",
    "sharp-cli": "^1.15.0",
    "toggle-switch-react-native": "^3.3.0",
    "url": "^0.11.0",
    "util": "^0.12.4"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "dotenv": "^10.0.0",
    "react-native-svg-app-icon": "^0.5.0"
  },
  "resolutions": {
    "expo-modules-autolinking": "~0.8.1"
  },
  "private": true,
  "rnpm": {
    "assets": [
      "./src/fonts/"
    ]
  },
  "name": "..",
  "version": "1.0.0"
}

OK, so the above mentions @react-native-clipboard/clipboard and @react-native-community/clipboard.

I see you have this in your dependencies:

You should not have both @react-native-community/clipboard and @react-native-clipboard/clipboard installed. The former has been superseded by the latter. Also, I suspect you should not have expo-clipboard installed as well.

So I suggest you pick either @react-native-clipboard/clipboard or expo-clipboard and uninstall the other two.

1 Like

Thank you soooo much that’s working thank youu

1 Like