安卓Twitter Fabric SDK与支持库冲突

4

我在使用Twitter Fabric SDK时遇到了问题。当我集成sdk并尝试构建时,出现以下错误信息:

错误:未找到com.android.support:support-v4:21.0.0

这是我的gradle.build文件:

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

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'

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

apply plugin: 'io.fabric'

android {
    compileSdkVersion 19
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.eventz.android"
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 13
        versionName '1.1.2'
    }

    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
dependency.
    compile 'com.android.support:support-v4:21.+'
    compile 'com.android.support:appcompat-v7:20.+'
    compile 'com.google.android.gms:play-services:5.0.+'
    compile project(':facebook')
    compile fileTree(dir:'libs', include:['*.jar'])
    compile files('libs/volley.jar')
    compile files('libs/Parse-1.5.1.jar')

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

我也尝试删除该支持库,但是我收到了以下错误信息:

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not resolve com.android.support:support-v4:21.0.0.
     Required by:
         Eventz:app:unspecified > com.android.support:appcompat-v7:20.0.0
      > Could not GET 'https://maven.fabric.io/repo/com/android/support/support-v4/21.0.0/support-v4-21.0.0.pom'. Received status code 401 from server: Unauthorized
   > Could not resolve com.android.support:support-v4:21.0.0.
     Required by:
         Eventz:app:unspecified > com.google.android.gms:play-services:5.0.89
      > Could not GET 'https://maven.fabric.io/repo/com/android/support/support-v4/21.0.0/support-v4-21.0.0.pom'. Received status code 401 from server: Unauthorized
   > Could not resolve com.android.support:support-v4:21.0.0.
     Required by:
         Eventz:app:unspecified > Eventz:facebook:unspecified
      > Could not GET 'https://maven.fabric.io/repo/com/android/support/support-v4/21.0.0/support-v4-21.0.0.pom'. Received status code 401 from server: Unauthorized
   > Could not resolve com.android.support:support-v4:21.0.0.
     Required by:
         Eventz:app:unspecified > com.twitter.sdk.android:twitter:1.0.1 > com.twitter.sdk.android:tweet-ui:1.0.1
      > Could not GET 'https://maven.fabric.io/repo/com/android/support/support-v4/21.0.0/support-v4-21.0.0.pom'. Received status code 401 from server: Unauthorized
1个回答

9
我是来自Fabric的Hemal,很高兴能够帮忙。我们需要Android L的支持库作为Twitter kit的一部分,但你可以轻松获取-前往Android SDK管理器,然后选择这里的v20支持库和支持库存储库进行安装: enter image description here 安装完成后,重新构建即可。让我知道进展如何。

2
那么,这个链接:https://get.fabric.io/crashlytics "我们不需要链接任何额外的框架或库" 是不正确的吗? - racs
更新SDK上的Extras后,这里也出现了问题,无法正常工作。 - Gujarat Santana

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接