expo / create-react-native-app

Create React Native apps that run on iOS, Android, and web
BSD 3-Clause "New" or "Revised" License
13.26k stars 1.35k forks source link

Expo template build fails (drawer-navigation) #913

Open lcundiff opened 1 year ago

lcundiff commented 1 year ago

Describe the bug Android build fails for drawer-navigation expo template with this error: Execution failed for task ':app:mergeDexRelease'. More error info in context section. However, I was able to successfully build the default app template. So I don't believe it is due to my system. Is there an expo version requirement for this template above 45? I have not edited any file, merely downloaded and built.

To Reproduce Steps to reproduce the behavior:

  1. Run npx create-react-native-app
  2. Give app name and choose expo template
  3. Scroll down to drawer-navigation template and select it
  4. Allow it to finish installing and cd into app folder
  5. Run npm i
  6. Run eas build -p android

Expected behavior Build should succeed.

Desktop:

Additional context Build error occurs with "Task :app:mergeDexRelease"

Task :app:mergeDexRelease FAILED
[stderr] ERROR:/home/expo/workingdir/build/node_modules/@react-native-community/masked-view/android/build/.transforms/53358cd9a1a26d387439d2f81db3c114/transformed/classes/classes.dex: D8: Type org.reactnative.maskedview.BuildConfig is defined multiple times: /home/expo/workingdir/build/node_modules/@react-native-community/masked-view/android/build/.transforms/53358cd9a1a26d387439d2f81db3c114/transformed/classes/classes.dex, /home/expo/workingdir/build/node_modules/@react-native-masked-view/masked-view/android/build/.transforms/277d621c3eeec8cb26e62f414fafa4e8/transformed/classes/classes.dex

Final error log:

[stderr] FAILURE: Build completed with 2 failures.

[stderr] 1: Task failed with an exception.

[stderr] -----------

[stderr] * What went wrong:

[stderr] Execution failed for task ':app:mergeDexRelease'.

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

[stderr]    > There was a failure while executing work items

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

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

[stderr]            Type org.reactnative.maskedview.BuildConfig is defined multiple times: /home/expo/workingdir/build/node_modules/@react-native-community/masked-view/android/build/.transforms/53358cd9a1a26d387439d2f81db3c114/transformed/classes/classes.dex, /home/expo/workingdir/build/node_modules/@react-native-masked-view/masked-view/android/build/.transforms/277d621c3eeec8cb26e62f414fafa4e8/transformed/classes/classes.dex