【发布时间】:2015-10-05 23:50:51
【问题描述】:
这是我得到的错误:
错误:(14, 13) 无法解决:com.facebook.android:facebook-android-sdk:4.6.0 在文件中显示
在项目结构对话框中显示
我可以在 Gradle 控制台中看到它正在本地 SDK 库中查找 lib,尽管我确保未选中 gradle 设置中的脱机工作复选框。
这是我的 build.gradle 文件:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}
}
apply plugin: 'com.android.application'
dependencies {
compile fileTree(include: '*.jar', dir: 'libs')
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.google.android.gms:play-services-identity:8.1.0'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
}
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
defaultConfig {
targetSdkVersion 23
}
productFlavors {
}
}
有什么想法吗?
【问题讨论】:
标签: android android-studio gradle build.gradle facebook-sdk-4.0