Firebaseui-android: [Known Issue] Error: Failed to resolve: com.twitter.sdk.android:twitter:2.0.0 when syncing with Gradle

Created on 4 Nov 2016  ยท  41Comments  ยท  Source: firebase/FirebaseUI-Android

If you are upgrading a project to version 1.0.0 you may encounter the error Failed to resolve: com.twitter.sdk.android:twitter:2.0.0 when syncing your project with Gradle. Version 1.0.0 has added a new required configuration step. To resolve this issue you must add the Fabric repository to your repositories:

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

Most helpful comment

Adding this to readme will be better.

All 41 comments

Adding this to readme will be better.

@kirtan403 we have it in the auth README. You don't need this repository addition if you're only using database or storage.

@samtstern Ohh.. I didn't checked the auth one. I checked the main one. Thanks for pointing that out. ๐Ÿ˜„ Is it really needed even if I do not use twitter authentication?

@kirtan403 it's needed just to get gradle to be happy since the Twitter Android SDK is listed as a transitive dependency in the pom.xml. If you use ProGuard on your application this should not have a large size impact.

We are looking for ways in later versions to remove this friction.

I have added fabric repository to build.gradle(App) as -

repositories {
    mavenLocal()
    flatDir {
        dirs 'libs'
    }
    maven { url 'https://maven.fabric.io/public' }
}

Getting Error -

Error:Could not download gson.jar (com.google.code.gson:gson:2.6.1): No cached version available for offline mode

I added gson dependency but didn't work.
@amandle @samtstern Please Suggest.

@kirtan403 did your issue resolved by adding fabric repo only ?

@jay-thakur see this stack overflow post on how to turn off offline mode: http://stackoverflow.com/q/28712025/4548500

And of course make sure you are online.

@SUPERCILEX thanks. Worked.

Even adding the reference the problem remains guys (same as reported in the issue title). I can compile only in the 0.6.2 version.

My gradle:

(...)
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
(...)

I'm syncing with the online configuration.

Thanks!

I had the same problem in 1.0.0 and solved it.
I have an android app module with an android library module (authentication).
The authentication module has dependency on firebaseUI. I received the error above and solved it by adding the repositories to both build.gradle files. Not sure why this works, but I hope it helps:

app/build.gradle:

android {

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

authentication/build.gradle:

android {

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

Yeah @GaborPeto, i have two modules and the problem is solved now when i just put the repository in the app\build.gradle

Before i was trying to put the declaration on build.gradle general file common to all sub-projects/modules

There is no need for me to repeat the repository in the two build.gradle files for both of modules.

Anyway thanks very mutch GaborPeto for the advice!

I'm pretty sure I tested that the I got the error if I didn't put the repositories into both build.gradle files. But if you're saying it is working I might just double check it as I really don't like the fact that I have to duplicate that piece of config.

So just an update on my previous comment:
Removing the config

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

from either of app/build.gradle or authentication/build.gradle results in Failed to resolve: com.twitter.sdk.android:twitter:2.0.0 exception.

@GaborPeto Add repository to allprojects as well.

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

buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.google.gms:google-services:3.0.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
}

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

Thanks @isurum, that works too

How can I resolve this issue?
failed to resolve com.twitter.sdk.android:twitter:2.2.0 firebase

9

@yawarali Check the first post.

Add this line:
maven { url 'https://maven.fabric.io/public' }
inside repositories in the screenshot you posted.

Same Issue :)
10

@yawarali, put it in your allprojects repositories. ๐Ÿ˜„

@yawarali You already have repositories section (just above the error). Just add that single line after jcenter().

@kirtan403 I did as you said. Please see second screenshot.
@SUPERCILEX what is "allprojects"? Where is it?

@yawarali:
image

@SUPERCILEX I was just creating it in paint! Thanks ๐Ÿ˜„ You were quick

@kirtan403 I have a secret trick for being so fast: the "Snipping Tool". It's the best thing ever! You can quickly select an area to take a screenshot of and then Ctrl+C and Ctrl+V it directly into a post. It's way faster than PrtScr->paste into paint->crop->select all->copy 'n paste. Anyway, just me being nerdy. ๐Ÿ˜„

@SUPERCILEX haha! I didn't knew it can be pasted directly here! I though I can just drag the jpg/png here! Now windows ink tool with screen sketch is also good! Thanks for the tip ๐Ÿ˜ƒ

Hahaha guys new error
Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.firebaseui:firebase-ui-auth:1.0.1] C:\Users\Qaisar Aslam Mayo\AndroidStudioProjects\FirebaseDemoapp\build\intermediates\exploded-aar\com.firebaseuifirebase-ui-auth\1.0.1\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="com.firebase.ui.auth" to force usage
11

FirebaseUI only support minSdk 16 so you have to go to your app build.gradle and set minSdkVersion 16.

@kirtan403 @SUPERCILEX Thanks guys all issue are resolved. This is my first experience, real time communication.

@yawarali Your welcome ๐Ÿ‘ Enjoy firebase ๐Ÿ˜„

@yawarali Glad to hear that! Have fun! ๐Ÿ˜„

In my case com.twitter.sdk.android:twitter:2.0.0 was solved adding the code below into app/gradle and upgrading minSdkVersion to 16: android { repositories { maven { url 'https://maven.fabric.io/public' } } }

Thanks! :) @GaborPeto @SUPERCILEX

P.S. Sorry for the format, I have never posted an issue before :(

just an update in case this is still confusing some:
Adding the dependency to the allprojects section did not work, I had to add it to the android section in the same module that had the firebase-auth-ui dependency.

@samtstern Since 1.1.0 has been released, do you think this issue can be closed now? It was mostly intended as an upgrade guide for 1.0.0 which is now outdated.

I think given that it's in the Auth README we can close this issue. It's not "fixed" but the workaround is documented.

I found the solution:
1- in project build.gradle add fabric repository in one place as below:

allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }
}

2- in project manifest file make sure to change rtl support to false as it conflict with firebase-ui:

    <application
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        **android:supportsRtl="false"**
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

I followed the guide in the README for version 1.2.0 adding the needed dependency and fabric repository
and ran into thease errors here after Gradle sync..

Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.

Is there a documented workaround for errors in this area?

@BrownEli that sounds like something different, please file a new issue

@BrownEli I am getting the same error, how did you solve it?

I just used a newer version on the library.

On May 22, 2017 23:32, "Mohammed Faisal" notifications@github.com wrote:

@BrownEli https://github.com/browneli I am getting the same error, how
did you solve it?

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/firebase/FirebaseUI-Android/issues/392#issuecomment-303212161,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANFFcS802kvX5xBCxqBM2LmbKtQ521dDks5r8fDvgaJpZM4KqEBo
.

@BrownEli Thanks and here by 'library' you mean firebase auth ui. Right???

help

I am having this issue now !! How to fix this problem
Even i didnt integrate my app with twitter

My guess is because, firebaseui is also also adding the facebook app id,
you need to replace what the library is doing.
This should work! Let me know if it helped.

tools:replace="android:value"
android:value="your facebook app id"/>

On Aug 31, 2017 12:40, "nabeelnazir163" notifications@github.com wrote:

[image: help]
https://user-images.githubusercontent.com/30865060/29917075-33d39ff0-8e5a-11e7-97fb-142e878239e5.png

I am having this issue now !! How to fix this problem

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/firebase/FirebaseUI-Android/issues/392#issuecomment-326244749,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANFFcZAKMlv1nSU7sm1CnASS7jx-ZRnhks5sdn-CgaJpZM4KqEBo
.

Was this page helpful?
0 / 5 - 0 ratings