无法导入Facebook的SDK 4.0.1 [英] Can not import facebook-sdk 4.0.1
问题描述
我有机器人工作室1.1.0和我刚刚创建了一个新的项目,我试图导入新的Facebook-SDK 4.0.1,但不能做到这一点,我也跟着的 Facebook的入门
I have android studio 1.1.0 and i just created a new project and i'm trying to import new facebook-sdk 4.0.1 but can not do this, I followed Facebook Getting Started
但无法得到它的工作。我的应用程序结构
But can not get it work. My app structure
我build.gradle(项目:MyApplication的)文件是:
My build.gradle(Project: MyApplication) file is:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
//mavenCentral()
}
}
我build.gradle(模块:应用程序)文件是:
My build.gradle(Module: app) file is:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.hema.myapplication"
minSdkVersion 9
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.1'
}
最后的错误信息是:
Finally the error message is:
Error:(28, 13) Failed to resolve: com.facebook.android:facebook-android-sdk:4.0.1
<a href="openFile">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
修改我加mavenCentral()在库的封盖,build.gradle(项目:所有MyApplication)文件,但不是在处理同样的错误信息
Edit I added mavenCentral() in the repositories closure in build.gradle(Project: MyApplication) file but not working with same error message.
推荐答案
我解决了这个问题,这是在我的摇篮设置>>未选中脱机工作
I solved the problem, It was in my Gradle settings >> Unchecked Offline work
这篇关于无法导入Facebook的SDK 4.0.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!