firebase / quickstart-android

Firebase Quickstart Samples for Android
https://firebase.google.com
Apache License 2.0
8.83k stars 7.32k forks source link

:app:transformClassesWithDesugarForDebug > com.android.build.api.transform.TransformException #363

Closed agentraymond232 closed 6 years ago

agentraymond232 commented 6 years ago

Step 3: Describe the problem:

If I include com.firebaseui:firebase-ui-auth:3.1.0 corresponding to the com.google.firebase:firebase-auth:11.4.2, then I can successfully get the OAuth access token from facebook login flow, but signing into Firebase with that credential fails with 10-28 18:01:02.471 3883-3883/com.my.android.app D/ray232: signInWithCredential:failure com.google.firebase.FirebaseException: An internal error has occurred. [ Unsuccessful debug_token response from Facebook:{"error" ] at com.google.android.gms.internal.zzdlj.zzak(Unknown Source) at com.google.android.gms.internal.zzdkl.zza(Unknown Source) at com.google.android.gms.internal.zzdlu.zzal(Unknown Source) at com.google.android.gms.internal.zzdlw.onFailure(Unknown Source) at com.google.android.gms.internal.zzdll.onTransact(Unknown Source) at android.os.Binder.execTransact(Binder.java:446)

For more information, view this SO question

Hence, I tried to match the version of the firebase-ui-auth and com.google.firebase:firebase-auth components with those mentioned in this repo. (Even though the versions of these components in this repo violates the requirements mentioned here.

Steps to reproduce:

  1. Include

    com.google.android.gms:play-services:11.4.2' compile 'com.google.firebase:firebase-auth:11.4.2' compile 'com.google.firebase:firebase-core:11.4.2' compile 'com.google.android.gms:play-services-iid:11.4.2' compile 'com.firebaseui:firebase-ui-auth:2.3.0'

  2. Build the project

Observed Results:

I am getting the following error while building my app

Error:Execution failed for task ':app:transformClassesWithDesugarForDebug'. com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {@ E:\Projects\My\App\Name\app\build\intermediates\tmp\desugar_args4999816675674775397}

Expected Results:

Since in this repo, the code must be compiling with these versions of the two components mentioned above, my code should also compile without any errors.

Relevant Code:

  // TODO(you): code here to reproduce the problem
samtstern commented 6 years ago

@agentraymond232 let's go back to your initial error, as you were headed in the right direction then:An internal error has occurred. [ Unsuccessful debug_token response from Facebook:{"error" ]

That normally means you have not set up your package name / signature correctly in the Facebook console. Please check out Facebook's debugging instructions to make sure your key hash is correct.

agentraymond232 commented 6 years ago

@samtstern, Are you sure the Unsuccessful debug_token response is due to an invalid key hash. Because I am able to successfully retrieve an Oauth token from facebook. I had no problems with that.

samtstern commented 6 years ago

It could also be that you have not correctly set up your Facebook App ID / App Secret in the Firebase console, looks like the same issue as this one: https://github.com/firebase/FirebaseUI-Android/issues/660

agentraymond232 commented 6 years ago

There are basically three things that could go wrong between the firebase app and the facebook app: the facebook app ID, facebook app secret, and the firebase app redirect URL. The first two need to be stored in the firebase app and the last one in the facebook app. I checked them a dozen times to be correct.

The problem is, the stacktrace of the error was hardly informative. Class names and method names such as zza and zzb didn't give any information as to at which stage did firebase fail to get a proper response from facebook. Hence I thought that someone who has worked on this a lot would be able to guide.

agentraymond232 commented 6 years ago

I had already gone through and commented on the issue that you have referenced in your last comment. After that I verified a lot of times that my appId, app secret and the redirect URL were correct.

samtstern commented 6 years ago

@agentraymond232 I appreciate your frustration, the zza and zzb classes are a result of the SDK being proguarded before distribution and they're not easier for us to understand either!

Unfortunately this still seems like an issue coming from the Facebook side, which is why I am not sure what's going on. When you say "Because I am able to successfully retrieve an Oauth token from facebook. I had no problems with that." do you mean that you can use Facebook Login in your app outside of FirebaseUI?

PatrickDattilio commented 6 years ago

I get the same desugar error, which seems to be unresolvable without downgrading Firebase and Play Services to 11.0.4

sfacs commented 6 years ago

I am getting the same error as well. This is a really blocking issue for me. I am running AS 3.0 stable on Windows. It just won't compile using Play Services 11.4.2 and Firebase 11.4.2.

soshial commented 6 years ago

Switching to these versions and rebuild project resolved the issue.

compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.facebook.android:facebook-login:4.28.0'
compile 'com.google.android.gms:play-services-auth:11.6.0'
agentraymond232 commented 6 years ago

@samtstern Yes. Till now, I was not using FirebaseUI at all. I mean, I had imported it, but was not using it yet. So I was using the Facebook Login SDK myself and could successfully access the accesstoken in the registered call back.

My only hope is to resolve the two questions I have:

  1. What does this error "An internal error has occurred. [ Unsuccessful debug_token response from Facebook:{"error" ]" even mean?

  2. While using Java 7, there was no problems compiling my code with the library versions matching the ones supplied in this repo (but violating the constraints mentioned on the Firebase UI documentation). However, with Java 8 enabled, I get desugaring exceptions. Shouldn't this behaviour be standard, as in whatever library versions compile together in Java 7 should compile in java 8 as well, and whatever library versions don't compile together in Java 7 should not compile together in Java 8 as well? Why this discrepancy?

Shajeel-Afzal commented 6 years ago

@soshial! 11.6.0 is not supported yet with the FirebaseUI-Android library. It gives the error in the dexMerger that auth:11.4.2 is being used in a library. So, the best thing we can do is that to wait for the FirebaseUI-Android team to release the new version of which is using auth:11.6.0

sandeeplondhe commented 6 years ago

I am getting the same error, please let me know if anyone have any solution about it.

Error:Execution failed for task ':app:transformClassesWithDesugarForDebug'.

com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {@D:\SureshBhanushaliGujrat\FCCChat\newsource\whatsclone\app\build\intermediates\tmp\desugar_args4306755243322603004}

Here is my Gradle file in app folder

buildscript { repositories { maven { url 'https://maven.fabric.io/public' } }

dependencies {
    classpath 'io.fabric.tools:gradle:+'
}

} apply plugin: 'com.android.application' apply plugin: 'io.fabric' apply plugin: 'realm-android'

repositories { mavenCentral() maven { url "https://jitpack.io" } maven { url 'https://maven.google.com' }//for android O maven { url 'https://maven.fabric.io/public' } maven { url 'https://github.com/leonardocardoso/mvn-repo/raw/master/maven-deploy' } }

android { compileSdkVersion 26 buildToolsVersion '26.0.2'

defaultConfig {
    applicationId "com.fccchat"
    resValue 'string', 'package_name', applicationId
    minSdkVersion 16
    targetSdkVersion 26
    versionCode 1
    versionName "1.0.0"
    multiDexEnabled true
    vectorDrawables.useSupportLibrary = true
    renderscriptTargetApi 26
    renderscriptSupportModeEnabled true

}

lintOptions {
    disable 'RestrictedApi'
}//this until  Google release a fix .bottomsheet super
dexOptions {
    preDexLibraries true
    javaMaxHeapSize "4g"
    dexInProcess = true
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
    release {
        proguardFiles 'proguard-rules.txt'
    }
    debug {
        minifyEnabled false
        shrinkResources false
        renderscriptDebuggable false
        jniDebuggable false
        proguardFiles 'proguard-rules.txt'
        signingConfig signingConfigs.debug
    }

}

packagingOptions {
    exclude '.readme'
    exclude 'LICENSE.txt'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LGPL2.1'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/README.txt'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/services/javax.annotation.processing.Processor'
    exclude 'META-INF/MANIFEST.MF'
}

}

dependencies { implementation fileTree(dir: 'libs', include: ['*.jar'])

def supportLibsVer = "26.+"
def googlePlayServicesVer = "11.6.0"
implementation "com.android.support:appcompat-v7:$supportLibsVer"
implementation "com.android.support:cardview-v7:$supportLibsVer"
implementation "com.android.support:design:$supportLibsVer"
implementation "com.android.support:recyclerview-v7:$supportLibsVer"
implementation "com.android.support:palette-v7:$supportLibsVer"
//noinspection GradleCompatible
implementation "com.google.android.gms:play-services-ads:$googlePlayServicesVer"
implementation "com.google.android.gms:play-services-drive:$googlePlayServicesVer"
implementation "com.google.firebase:firebase-messaging:$googlePlayServicesVer"
implementation 'com.android.support:multidex:1.0.2'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'jp.wasabeef:glide-transformations:2.0.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'jp.wasabeef:picasso-transformations:2.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.6.0'
implementation 'com.squareup.okhttp3:okhttp:3.8.1'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.2'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.github.hani-momanii:SuperNova-Emoji:1.1'
implementation 'me.leolin:ShortcutBadger:1.1.16@aar'
implementation('io.socket:socket.io-client:1.0.0') {
    // excluding org.json which is provided by Android
    exclude group: 'org.json', module: 'json'
}
implementation('com.github.ozodrukh:CircularReveal:2.0.1@aar') {
    transitive = true;
}
implementation 'joda-time:joda-time:2.9.7'
implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
    transitive = true;
}
implementation 'com.googlecode.libphonenumber:libphonenumber:8.5.2'
implementation 'com.orhanobut:logger:1.15'
implementation 'io.pristine:libjingle:11139@aar'
implementation 'pl.bclogic:pulsator4droid:1.0.3'
implementation 'com.github.yalantis:ucrop:2.2.1-native'
implementation 'org.jsoup:jsoup:1.8.3' // required for link preview
implementation 'com.leocardz:link-preview:1.2.2@aar'
implementation 'com.facebook.network.connectionclass:connectionclass:1.0.1'
implementation 'com.facebook.android:account-kit-sdk:4.+'

} apply plugin: 'com.google.gms.google-services'

Gradle file in project root

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript { repositories { jcenter() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' classpath "io.realm:realm-gradle-plugin:4.2.0" classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' classpath 'com.google.gms:google-services:3.1.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }

allprojects { repositories { jcenter() mavenCentral() } }

task clean(type: Delete) { delete rootProject.buildDir }

samtstern commented 6 years ago

This is a pretty old issue and I believe nothing further can be done here. Closing....