简体   繁体   中英

Twitter Fabric Gradle Error

I am trying to integrate Twitter Login in my app, according to Twitter Fabric docs I am to add

compile('com.twitter.sdk.android:twitter-core:1.6.0@aar') {
    transitive = true;
}

to my code to be able to compile but the Gradle is failing to resolve the Library I am getting the

Error:(25, 13) Failed to resolve: com.twitter.sdk.android:twitter-core:1.6.0

Show in File
Show in Project Structure dialog

and here is my full gradle file

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
    applicationId "xxxx.xxxx.xxxx.xxxxx"
    minSdkVersion 11
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
productFlavors {
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile('com.twitter.sdk.android:twitter-core:1.6.0@aar') {
    transitive = true;
}
}

I fixed it by modifying my build.gradle

   buildscript {
   repositories {
   jcenter()
   maven { url 'https://maven.fabric.io/public' }
   }
  dependencies {
  classpath 'com.android.tools.build:gradle:1.0.+'
  // The Fabric Gradle plugin uses an open ended version to
  // react quickly to Android tooling updates
  classpath 'io.fabric.tools:gradle:1.+'
  }
 }

apply plugin: 'com.android.application'

  //Put Fabric plugin after Android plugin
  apply plugin: 'io.fabric'

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

and ofcourse adding the compile ('com.twitter.sdk.android:twitter:1.6.0@aar'){ transitive = true; } } compile ('com.twitter.sdk.android:twitter:1.6.0@aar'){ transitive = true; } }

in my top level gradle file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM