firebase / FirebaseUI-Android

Optimized UI components for Firebase
https://firebaseopensource.com/projects/firebase/firebaseui-android/
Apache License 2.0
4.63k stars 1.84k forks source link

Build fails when upgrading from gradle 4.1 to 4.4 #1149

Closed btrautmann closed 6 years ago

btrautmann commented 6 years ago

Step 1: Are you in the right place?

Yes

Step 2: Describe your environment

Step 3: Describe the problem:

Steps to reproduce:

  1. Set gradle version to 4.4 (distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip)
  2. Sync, (clean), and rebuild

Observed Results:

Error:Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: there were 11 duplicate class definitions.
      (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Unexpected error while evaluating instruction:
  Class       = [com/firebase/ui/auth/util/signincontainer/IdpSignInContainer]
  Method      = [onCreate(Landroid/os/Bundle;)V]
  Instruction = [90] putfield #174
  Exception   = [java.lang.IllegalArgumentException] (Can't find common super class of [com/firebase/ui/auth/provider/FacebookProvider] (with 2 known super classes) and [com/firebase/ui/auth/provider/TwitterProvider] (with 1 known super classes))
Unexpected error while performing partial evaluation:
  Class       = [com/firebase/ui/auth/util/signincontainer/IdpSignInContainer]
  Method      = [onCreate(Landroid/os/Bundle;)V]
  Exception   = [java.lang.IllegalArgumentException] (Can't find common super class of [com/firebase/ui/auth/provider/FacebookProvider] (with 2 known super classes) and [com/firebase/ui/auth/provider/TwitterProvider] (with 1 known super classes))
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithProguardForDebug'.
> Job failed, see logs for details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

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

BUILD FAILED in 23s

Expected Results:

samtstern commented 6 years ago

@btrautmann is the project where this is happening on Github somewhere? I'd love to take a look.

btrautmann commented 6 years ago

@samtstern unfortunately it's closed source, but I'd be happy to share our dependencies block if that would help at all?

samtstern commented 6 years ago

Can't hurt, please share!

On Thu, Feb 15, 2018, 6:55 PM Brandon Trautmann notifications@github.com wrote:

@samtstern https://github.com/samtstern unfortunately it's closed source, but I'd be happy to share our dependencies block if that would help at all?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/firebase/FirebaseUI-Android/issues/1149#issuecomment-366131537, or mute the thread https://github.com/notifications/unsubscribe-auth/AIEw6jCesnv-HW8kDefC1TX5AOtJVQxbks5tVO42gaJpZM4SEyFl .

btrautmann commented 6 years ago

@samtstern, Here's the important stuff:

app build.gradle

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
...
defaultConfig {
    applicationId "..."
    minSdkVersion 19
    targetSdkVersion 27
    versionCode 18
    versionName "0.3.3"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    flavorDimensions "default"
}

// Third party
dependencies {
    // Firebase
    implementation "com.google.firebase:firebase-core:$playServicesVersion"
    implementation('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
        transitive = true
    }
    implementation "com.firebaseui:firebase-ui-auth:$firebaseUiAuthVersion"
    implementation "com.google.firebase:firebase-firestore:$playServicesVersion"
    // Play Services
    implementation "com.google.android.gms:play-services-location:$playServicesVersion"
    // Support
    implementation "com.android.support:support-compat:$supportLibraryVersion"
    implementation "com.android.support:design:$supportLibraryVersion"
    implementation "com.android.support:cardview-v7:$supportLibraryVersion"
    // Architecture Components
    implementation "android.arch.lifecycle:extensions:$architectureComponentsVersion"
    kapt "android.arch.lifecycle:compiler:$architectureComponentsVersion"
    // RxJava2
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.5'
    implementation 'com.jakewharton.rxrelay2:rxrelay:2.0.0'
    // Logging
    implementation 'com.jakewharton.timber:timber:4.6.0'
}
...
apply plugin: 'com.google.gms.google-services'

Project build.gradle:

ext {
    playServicesVersion = '11.8.0'
    supportLibraryVersion = '27.0.2'
    firebaseUiAuthVersion = '3.2.1'
    architectureComponentsVersion = '1.1.0'
}

In gradle-wrapper.properties (when changed back to 4.1, build is fine) distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

Please let me know if you need anything else.

samtstern commented 6 years ago

@btrautmann I started a new project and mimicked your exact gradle file, I also set minifyEnabled true in the release build type.

No change in the gradle wrapper version could reproduce the error you have, so it's likely there is something more complicated going on rather than a general incompatibility between FirebaseUI and Gradle 4.4

This is also confirmed by the fact that our 3.2.2-dev branch build successfully with Gradle 4.5, and that build includes the app module which should expose these kinds of errors.

Since this is something to do with the configuration of your app, I'd suggest sharing more about your application or moving to StackOverflow which is better suited to this kind of troubleshooting,

btrautmann commented 6 years ago

Thanks @samtstern, I'll close this for now and open a new one if it ends up being something related to FirebaseUI after I do a deeper investigation...

samtstern commented 6 years ago

Thanks Brandon! Happy to help if you think you have a new angle on this one.

On Fri, Feb 16, 2018 at 9:28 AM Brandon Trautmann notifications@github.com wrote:

Thanks @samtstern https://github.com/samtstern, I'll close this for now and open a new one if it ends up being something related to FirebaseUI after I do a deeper investigation...

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/firebase/FirebaseUI-Android/issues/1149#issuecomment-366302457, or mute the thread https://github.com/notifications/unsubscribe-auth/AIEw6g5nW_ltlJ2zrMImjnM3YQVECActks5tVbq2gaJpZM4SEyFl .