Android Twitter Fabric SDK 与支持库冲突 [英] Android Twitter Fabric SDK conflict with support library

查看:19
本文介绍了Android Twitter Fabric SDK 与支持库冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 Twitter Fabric SDK 时遇到了问题.当我集成 sdk 并尝试构建时,出现此错误;

I have a problem with Twitter Fabric SDK. When I integrate the sdk and try to build, I get this error;

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

这是我的 gradle.build 文件

And this is my gradle.build file

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

我也尝试删除该支持库,但出现此错误;

I also tried to remove that support library but the I get this error;

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 的支持库进行安装:

Hemal from Fabric here, I'd love to help with this. We require the support library for Android L as part of the Twitter kit but it should be easy for you to grab- go to the Android SDK manager, and then select the support library and the support repository for v20 here to install:

安装后,您可以重新构建,您应该可以开始使用了!让我知道进展如何.

Once that's installed, you can re-build and you should be good to go! Let me know how it goes.

这篇关于Android Twitter Fabric SDK 与支持库冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆