Closed jcmbmercadoni closed 6 years ago
Could you try adding this dependency to your app:
implementation android.arch.lifecycle:runtime:1.1.1
@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:
database
, but is not present with auth
.common
, so that narrows it down a lot.These are all the dependencies of common
4.0.1
:
<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>
3.3.1
-- healthy4.0.0
-- unhealthy4.0.1
-- unhealthyThese are the dependencies of common
3.3.1
:
<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 27.0.2
which has these interesting dependencies:
+--- android.arch.lifecycle:runtime:1.0.3@aar
+--- android.arch.lifecycle:common:1.0.3@jar
\--- android.arch.core:common:1.0.0@jar
But 27.1.1
has these:
+--- android.arch.lifecycle:livedata-core:1.1.0@aar
+--- android.arch.lifecycle:viewmodel:1.1.0@aar
+--- android.arch.lifecycle:runtime:1.1.0@aar
+--- android.arch.lifecycle:common:1.1.0@jar
+--- android.arch.core:runtime:1.1.0@aar
\--- android.arch.core:common:1.1.0@jar
You can work around this by specifying a specific core dependency:
implementation "android.arch.core:runtime:$version"
implementation "android.arch.core:common:$version"
@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 build.gradle
file in order to give it a hint.
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.
Yeah, and the output of ./gradlew app:dependencies
would be nice too. It's because of this:
Someone is using a version smaller than 1.1.1
of arch:runtime
.
@SUPERCILEX did they really do that in a post-1.0.0 non-major release? :man_facepalming:
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:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId "xxxxxx"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// Support library
implementation "com.android.support:design:27.1.1"
implementation "com.android.support:cardview-v7:27.1.1"
implementation "com.android.support:support-v4:27.1.1"
implementation "com.android.support:appcompat-v7:27.1.1"
// Firebase
implementation "com.google.firebase:firebase-storage:16.0.1"
implementation "com.google.firebase:firebase-core:16.0.0"
implementation "com.google.firebase:firebase-auth:16.0.1"
implementation "com.google.android.gms:play-services-auth:15.0.1"
// implementation "com.google.firebase:firebase-database:$playServicesVersion"
implementation "com.google.firebase:firebase-appindexing:15.0.1"
implementation "com.google.firebase:firebase-firestore:15.0.0"
implementation 'com.firebaseui:firebase-ui-firestore:4.0.1'
// Third party
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.facebook.android:facebook-android-sdk:4.+'
implementation 'jp.wasabeef:recyclerview-animators:2.2.3'
implementation 'com.github.clans:fab:1.6.2'
implementation 'de.hdodenhof:circleimageview:2.0.0'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.squareup.okhttp3:okhttp:3.1.2'
implementation 'com.github.PhilJay:MPAndroidChart:v2.2.2'
implementation 'com.google.code.gson:gson:2.6.2'
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.android.support:multidex:1.0.3'
// implementation "android.arch.core:runtime:1.1.1"
// implementation "android.arch.core:common:1.1.1"
}
apply plugin: 'com.google.gms.google-services'
Gradle 2:
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.2.1'
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://jitpack.io' }
maven { url "https://maven.google.com" }
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext {
supportLibVersion = "27.1.1"
playServicesVersion = "17.0.1"
}
Thanks! Would you mind sharing the output of running ./gradlew app:dependencies
in the terminal?
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