Android Twitter Fabric SDK 与支持库冲突

标签 android twitter integration twitter-fabric

我对 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

最佳答案

来自 Fabric 的 Hemal,我很乐意为此提供帮助。我们需要 Android L 的支持库作为 Twitter 工具包的一部分,但您应该很容易获取 - 转到 Android SDK 管理器,然后在此处选择支持库和 v20 的支持存储库进行安装:

enter image description here

一旦安装完成,您就可以重新构建,您应该可以开始了!让我知道进展如何。

关于Android Twitter Fabric SDK 与支持库冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26944483/

相关文章:

Twitter 不记得授权

c++ - eclipse CDT : how to enable project debugging

java - ListView onItemClickListener 不工作。单击不起作用

android - 是否可以限制对文件 ://through Content Security Policy (CSP) 的任意访问

iphone - 推特发帖错误

java - 在 Leiningen 项目中 fork 一个 JVM

java - Spring Integration - 按名称读取文件

java - Android GPU 分析 - OpenGL 动态壁纸很慢

java - 使用适用于 Android 应用程序的自定义适配器将项目动态添加到 ListView

python - 使用 oauth 的 Twitter 身份验证问题?