-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build fails with 'Program type already present: android.arch.core.util.Function' #1357
Comments
Could you try adding this dependency to your app:
|
@samtstern thanks for your response. I tried, but the same error was generated. 😞 |
@jcmbmercadoni this may be a duplicate of #1344, but let's dive into it anyway. I can reproduce this error with only two dependencies: dependencies {
// Support
implementation 'com.android.support:appcompat-v7:27.1.1'
// FirebaseUI
implementation 'com.firebaseui:firebase-ui-firestore:4.0.1'
} So there has to be some issue there that's causing D8 to get angry. |
@SUPERCILEX this is so simple yet ... so broken. Do you have any ideas / have you seen this before? Some more datapoints:
These are all the dependencies of <dependencies>
<dependency>
<groupId>android.arch.lifecycle</groupId>
<artifactId>runtime</artifactId>
<version>1.1.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>android.arch.lifecycle</groupId>
<artifactId>viewmodel</artifactId>
<version>1.1.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>support-annotations</artifactId>
<version>27.1.1</version>
<scope>runtime</scope>
</dependency>
</dependencies>
These are the dependencies of <dependencies>
<dependency>
<groupId>android.arch.lifecycle</groupId>
<artifactId>runtime</artifactId>
<version>1.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>android.arch.lifecycle</groupId>
<artifactId>viewmodel</artifactId>
<version>1.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>support-annotations</artifactId>
<version>27.1.0</version>
<scope>runtime</scope>
</dependency>
</dependencies> |
The issue does not seem to exist with Support
But
|
You can work around this by specifying a specific core dependency:
|
@kurtisnelson I swear I tried that .... sigh I feel like such an idiot. Confirmed this works, thank you! dependencies {
// Support
implementation 'com.android.support:appcompat-v7:27.1.1'
// FirebaseUI
implementation 'com.firebaseui:firebase-ui-common:4.0.1'
// Arch
implementation "android.arch.core:runtime:1.1.1"
implementation "android.arch.core:common:1.1.1"
} |
Is this considered a solution or a workaround? |
@troy21688 unfortunately that is a "solution". Gradle is not always great at dependency management so many times you have to declare a hard version of a transitive dependency in your top-level Of course if you have a better solution we are all ears! |
Do you feel it is something Firebase will attempt to address in future dependencies? Or should I simply try to continue to isolate the conflict? |
I have been tweaking my code, I was able to eliminate some dependencies but am still having the issue. What would be best to post on my end to help resolve? |
@troy21688 post your whole dependencies block. If you can reproduce this with only a subset of dependencies, please post that. |
@SUPERCILEX did they really do that in a post-1.0.0 non-major release? 🤦♂️ |
Hehe, my thoughts exactly. It happened back in March though, so not sure why everything is blowing up now. 🤷♂️ |
Is it anticipated that Firebase will fix it in a future release? |
This isn't really our fault which means we can't do a whole lot—it's a side effect of us using lifecycle components to build FUI. Regardless, those logs would help us figure out your particular dependency conflict. |
Gradle:
Gradle 2:
|
Thanks! Would you mind sharing the output of running |
Environment
Issue
The app syncs gradle successfully however when trying to run the app the Gradle build fails.
Steps to reproduce:
Observed Results:
Gradle console output:
Gradle console output for
:app:transformDexArchiveWithExternalLibsDexMergerForDebug
Expected Results:
The app should run without issues.
Relevant Code:
Gradle file at app module
Please see this StackOverflow question
The text was updated successfully, but these errors were encountered: