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

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' }
}

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 35
  • Comments: 41 (5 by maintainers)

Most upvoted comments

Adding this to readme will be better.

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' }
  }
...

@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 }

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>

@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.

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\FirebaseDemo\app\build\intermediates\exploded-aar\com.firebaseui\firebase-ui-auth\1.0.1\AndroidManifest.xml Suggestion: use tools:overrideLibrary=“com.firebase.ui.auth” to force usage 11

@yawarali Check the first post.

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

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.

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!

@yawarali Your welcome 👍 Enjoy firebase 😄

@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 I was just creating it in paint! Thanks 😄 You were quick

@yawarali, put it in your allprojects repositories. 😄

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

9

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.