question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error: duplicate class: host.exp.exponent.BuildVariantConstants

See original GitHub issue

Environment

Environment: OS: macOS High Sierra 10.13.1 Node: 8.9.4 Yarn: Not Found npm: 5.6.0 Watchman: 4.9.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed) expo: ^25.0.0 => 25.0.0 react: 16.2.0 => 16.2.0 react-native: https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz => 0.52.0

Diagnostics report: https://exp-xde-diagnostics.s3.amazonaws.com/ethanyuwang-876dcc3b-6909-4dc3-9f80-bbd98e17dd98.tar.gz

ExpoKit

Steps to Reproduce

(Write your steps here:)

Detached to ExpoKit, trying to make React Native Firebase to work and followed this https://github.com/EvanBacon/expo-native-firebase. Ran into a million problems and now this:

Information:Gradle tasks [:app:assembleDevDevRemoteKernelProdDebug, :react-native-firebase:assembleDebug]
/Users/ethanwang/Github/reactnative/Glever/android/app/src/devRemoteKernel/java/host/exp/exponent/BuildVariantConstants.java
Error:(5, 8) error: duplicate class: host.exp.exponent.BuildVariantConstants
/Users/ethanwang/Github/reactnative/Glever/android/app/src/dev/java/host/exp/exponent/BuildVariantConstants.java
Error:(5, 8) error: duplicate class: host.exp.exponent.BuildVariantConstants
Error:Execution failed for task ':app:compileDevDevRemoteKernelProdDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
Information:BUILD FAILED in 3s
Information:3 errors
Information:0 warnings
Information:See complete output in console

(Write what happened. Add screenshots!)

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ethanyuwangcommented, Feb 12, 2018

I “fixed” it by reducing the flavors to one:

// Specifies two flavor dimensions.

  flavorDimensions "dev"

  productFlavors {
    // Define separate dev and prod product flavors.
    dev {
      // dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
      // to pre-dex each module and produce an APK that can be tested on
      // Android Lollipop without time consuming dex merging processes.
      dimension "dev"
      minSdkVersion 21
    }
    ...
  }
0reactions
lock[bot]commented, Jun 13, 2019

This thread has been automatically 🔒locked🔒 since there has not been any recent activity after it was closed. Oftentimes the underlying causes of old issues and steps to reproduce them are different from those of new issues. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I fix this "Duplicate class error" in Android Studio
I ran into the same issue today, and after many trial and errors, I finally found that it was caused by a firebase...
Read more >
[SOLVED] Duplicated classes when building for Android
I'm getting lots of errors when I try to compile for Android. CommandInvokationFailure: Gradle build failed.
Read more >
Duplicate definition of a class even though the "duplicate ...
The problem is, although the project is working as intended, Visual Studio is marking implementation classes of an abstract class as duplicates.
Read more >
Duplicate class error when attetmpting to run application on ...
When i run the program i get a “Duplicate Classes Failed” error and a whole host of gradle errors related to Duplicate classes...
Read more >
Duplicate class errors with Clover and JAXB or JAXB2 plugin
the build fails with a number of "duplicate class" errors: [INFO] [compiler:compile {execution: default-compile}] [DEBUG] Using compiler ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found