gpt4 book ai didi

java - Facebook SDK 导入错误

转载 作者:行者123 更新时间:2023-12-01 11:06:45 25 4
gpt4 key购买 nike

当我尝试将 FB SDK 导入我的项目时遇到问题。

这是我执行项目 clean 后的日志。

>Error:A problem occurred configuring root project 'XXX'.

> Could not resolve all dependencies for configuration ':_debugCompile'.

> Could not find com.parse.bolts:bolts-android:1.2.0.
Searched in the following locations:
file:/Users/OOO/Library/Android/sdk/extras/android/m2repository
/com/parse/bolts/bolts-android/1.2.0/bolts-android-1.2.0.pom
file:/Users/OOO/Library/Android/sdk/extras/android/m2repository
/com/parse/bolts/bolts-android/1.2.0/bolts-android-1.2.0.jar
file:/Users/OOO/Library/Android/sdk/extras/google/m2repository
/com/parse/bolts/bolts-android/1.2.0/bolts-android-1.2.0.pom
file:/Users/OOO/Library/Android/sdk/extras/google/m2repository
/com/parse/bolts/bolts-android/1.2.0/bolts-android-1.2.0.jar
Required by:
:XXX:unspecified > com.facebook.android:facebook:4.6.0

这是我的导入步骤

1) 导入模块

2)添加依赖项:facebook

3)修改gradle.properties如下

ANDROID_BUILD_SDK_VERSION = 23
ANDROID_BUILD_TOOLS_VERSION = 23.0.1
ANDROID_BUILD_MIN_SDK_VERSION = 15
ANDROID_BUILD_TARGET_SDK_VERSION =2

似乎不起作用...有什么办法可以解决这个问题吗?

我的build.gradle文件:

{
apply plugin: 'android'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile files('libs/gson-2.2.2.jar')
compile 'com.google.android.gms:play-services:7.3.0'
compile files('libs/GoogleConversionTrackingSdk-2.2.4.jar')
compile project(':facebook')
}

android {
compileSdkVersion 18
buildToolsVersion "21.1.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']
}

instrumentTest.setRoot('tests')

debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}

最佳答案

尝试在 builld.gradle 文件中添加此依赖项

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

将此模块或您的模块作为您为 Facebook SDK 添加的库删除

compile project(':facebook')

关于java - Facebook SDK 导入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32872158/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com