无法解析:com.facebook.android:facebook-android-sdk:4.4.0 [英] Failed to resolve: com.facebook.android:facebook-android-sdk:4.4.0

查看:458
本文介绍了无法解析:com.facebook.android:facebook-android-sdk:4.4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的build.gradle文件中的代码。

 应用插件:'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion23.0.0 rc3

defaultConfig {
applicationIdcom.example.test
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName1.0
}

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

repositories {
mavenCentral()
}

依赖关系{
编译fileTree(dir:'libs',include:['* .jar'])
compile'c​​om。 android.support:appcompat-v7:22.2.1'
compile'c​​om.facebook.android:facebook-android-sdk:4.4.0'
}

当我与Grad同步项目时le文件,它给我错误。

 错误:(28,13)无法解析:com.facebook.android:facebook -android-sdk:4.4.0 

任何人都可以告诉我为什么我得到这个错误? / p>

这里已经提到了类似的问题,但没有人回答。 (
无法解析:com.facebook .android:facebook-android-sdk:4.0.0

解决方案

最后花费6-8小时它。我得到了解决方案。您必须在您的应用程序 build.gradle 文件中更改存储库部分。将它从 mavenCentral 更改为 jcenter 如下

 存储库{
jcenter {
urlhttp://jcenter.bintray.com/
}
}

完成之后,您可以简单地将依赖关系添加为

 $ $ $ $ $ $ $ $ $ $ $ $ $ $ $

Below is code from my build.gradle file.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0 rc3"

    defaultConfig {
        applicationId "com.example.test"
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }

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

repositories {
   mavenCentral()
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.facebook.android:facebook-android-sdk:4.4.0'
}

When I do Sync project with gradle files, it gives me error.

  Error:(28, 13) Failed to resolve: com.facebook.android:facebook-android-sdk:4.4.0

Can anyone tell me why I'm getting this error?

Similar question has been asked here but no one has answered it. ( Failed to resolve: com.facebook.android:facebook-android-sdk:4.0.0 )

解决方案

Finally after spending 6-8 hours on it. I got the solution for you. You have to just change repositories section in your app build.gradle file. change it from mavenCentral to jcenter as following

repositories {
    jcenter {
        url "http://jcenter.bintray.com/"
    }    
}

After having this, You can simply add the dependency as

compile 'com.facebook.android:facebook-android-sdk:4.0.0'

这篇关于无法解析:com.facebook.android:facebook-android-sdk:4.4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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