Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
amandle opened this issue Nov 4, 2016 · 41 comments

Comments

@amandle
Copy link
Contributor

amandle commented Nov 4, 2016

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' }
}
@samtstern samtstern changed the title Error: Failed to resolve: com.twitter.sdk.android:twitter:2.0.0 when syncing with Gradle [Known Issue] Error: Failed to resolve: com.twitter.sdk.android:twitter:2.0.0 when syncing with Gradle Nov 6, 2016
@kirtan403
Copy link

Adding this to readme will be better.

@samtstern
Copy link
Contributor

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

@kirtan403
Copy link

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

@samtstern
Copy link
Contributor

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

@jay-thakur
Copy link

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 ?

@SUPERCILEX
Copy link
Collaborator

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

@jay-thakur
Copy link

@SUPERCILEX thanks. Worked.

@itpablo
Copy link

itpablo commented Nov 14, 2016

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!

@GaborPeto
Copy link

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

@itpablo
Copy link

itpablo commented Nov 15, 2016

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!

@GaborPeto
Copy link

GaborPeto commented Nov 15, 2016

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.

@GaborPeto
Copy link

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.

@isurum
Copy link

isurum commented Nov 26, 2016

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

@GaborPeto
Copy link

GaborPeto commented Nov 26, 2016

Thanks @isurum, that works too

@yawarali
Copy link

yawarali commented Dec 2, 2016

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

9

@kirtan403
Copy link

kirtan403 commented Dec 2, 2016

@yawarali Check the first post.

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

@yawarali
Copy link

yawarali commented Dec 2, 2016

Same Issue :)
10

@SUPERCILEX
Copy link
Collaborator

@yawarali, put it in your allprojects repositories. 😄

@kirtan403
Copy link

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

@yawarali
Copy link

yawarali commented Dec 2, 2016

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

@SUPERCILEX
Copy link
Collaborator

@yawarali:
image

@kirtan403
Copy link

kirtan403 commented Dec 2, 2016

@SUPERCILEX I was just creating it in paint! Thanks 😄 You were quick

@SUPERCILEX
Copy link
Collaborator

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

@kirtan403
Copy link

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

@yawarali
Copy link

yawarali commented Dec 2, 2016

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

@SUPERCILEX
Copy link
Collaborator

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

@yawarali
Copy link

yawarali commented Dec 2, 2016

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

@kirtan403
Copy link

@yawarali Your welcome 👍 Enjoy firebase 😄

@SUPERCILEX
Copy link
Collaborator

SUPERCILEX commented Dec 2, 2016

@yawarali Glad to hear that! Have fun! 😄

@Alfonsibo
Copy link

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 :(

@bpappin
Copy link

bpappin commented Dec 20, 2016

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.

@SUPERCILEX
Copy link
Collaborator

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

@samtstern
Copy link
Contributor

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

@ay1man4
Copy link
Contributor

ay1man4 commented Jan 17, 2017

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>

@BrownEli
Copy link

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?

@samtstern
Copy link
Contributor

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

@dmbfaisal
Copy link

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

@BrownEli
Copy link

BrownEli commented May 23, 2017 via email

@dmbfaisal
Copy link

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

@nabeelnazir163
Copy link

nabeelnazir163 commented Aug 31, 2017

help

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

@BrownEli
Copy link

BrownEli commented Sep 5, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests