我想在我的Eclipse項目中使用Facebook Android SDK作爲Maven依賴項。添加依賴到pom.xml後,我得到錯誤:Eclipse的Android項目項目與臉譜sdk作爲maven依賴項
Failed to execute goal on project test-client-android: Could not resolve dependencies for project com.test.:test-client-android:apk:0.1.0: Failure to find com.facebook.android:facebook-android-sdk:jar:4.6.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
以下是我的pom.xml文件。我試圖做maven更新,但沒有改變。哪裏不對?
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>test-client-android</artifactId>
<version>0.1.0</version>
<packaging>apk</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>support-v4</artifactId>
<version>23.0.1</version>
<scope>system</scope>
<systemPath>${env.ANDROID_HOME}/extras/android/support/v4/android-support-v4.jar</systemPath>
</dependency>
<dependency>
<groupId>com.mcxiaoke.volley</groupId>
<artifactId>library</artifactId>
<version>1.0.19</version>
</dependency>
<dependency>
<groupId>com.facebook.android</groupId>
<artifactId>facebook-android-sdk</artifactId>
<version>4.6.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>4.3.0</version>
<configuration>
<sdk>
<platform>23</platform>
</sdk>
<deleteConflictingFiles>true</deleteConflictingFiles>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
謝謝你的回答。現在我有另一個錯誤:無法執行項目test-client-android上的目標:無法解析項目的依賴關係com.test.:test-client-android:apk:0.1.0:無法收集com.facebook上的依賴關係。 android:facebook-android-sdk:jar:4.6.0 - > com.android.support:support-v4:jar:[22,23):沒有可用於com.android.support:support-v4:jar的版本:[ 22,23)在指定範圍內。 – Jacek
@Jacek可以通過下面的鏈接是示例代碼,它會幫助你.https://github.com/avianey/facebook-api-android-maven –
但是,如果我想使用官方,較新的版本呢?在這種情況下如何解決我的問題? – Jacek