facebook-android-sdk - 导入 FacebookSDK 时出错

标签 facebook-android-sdk android-support-library

我下载了 Facebook API 3.0 并将其导入到 Eclipse (Helion)。我创建了我的应用程序的新项目(称为 HAN Communication),并尝试将 FacebookSDK 添加为库。但在此之后我看到了这个错误:

[2013-02-03 11:28:06 - HANCommunication] Found 2 versions of android-support-v4.jar in the dependency list,
[2013-02-03 11:28:06 - HANCommunication] but not all the versions are identical (check is based on SHA-1 only at this time).
[2013-02-03 11:28:06 - HANCommunication] All versions of the libraries must be the same at this time.
[2013-02-03 11:28:06 - HANCommunication] Versions found are:
[2013-02-03 11:28:06 - HANCommunication] Path: D:\facebook-android-sdk-3.0\facebook-android-sdk-3.0\facebook\libs\android-support-v4.jar
[2013-02-03 11:28:06 - HANCommunication]    Length: 349252
[2013-02-03 11:28:06 - HANCommunication]    SHA-1: 612846c9857077a039b533718f72db3bc041d389
[2013-02-03 11:28:06 - HANCommunication] Path: D:\workspace\space\HANCommunication\libs\android-support-v4.jar
[2013-02-03 11:28:06 - HANCommunication]    Length: 385685
[2013-02-03 11:28:06 - HANCommunication]    SHA-1: 48c94ae70fa65718b382098237806a5909bb096e
[2013-02-03 11:28:06 - HANCommunication] Jar mismatch! Fix your dependencies
[2013-02-03 11:29:17 - HANCommunication] Found 2 versions of android-support-v4.jar in the dependency list,
[2013-02-03 11:29:17 - HANCommunication] but not all the versions are identical (check is based on SHA-1 only at this time).
[2013-02-03 11:29:17 - HANCommunication] All versions of the libraries must be the same at this time.
[2013-02-03 11:29:17 - HANCommunication] Versions found are:
[2013-02-03 11:29:17 - HANCommunication] Path: D:\facebook-android-sdk-3.0\facebook-android-sdk-3.0\facebook\libs\android-support-v4.jar
[2013-02-03 11:29:17 - HANCommunication]    Length: 349252
[2013-02-03 11:29:17 - HANCommunication]    SHA-1: 612846c9857077a039b533718f72db3bc041d389
[2013-02-03 11:29:17 - HANCommunication] Path: D:\workspace\space\HANCommunication\libs\android-support-v4.jar
[2013-02-03 11:29:17 - HANCommunication]    Length: 385685
[2013-02-03 11:29:17 - HANCommunication]    SHA-1: 48c94ae70fa65718b382098237806a5909bb096e
[2013-02-03 11:29:17 - HANCommunication] Jar mismatch! Fix your dependencies
[2013-02-03 11:34:45 - HANCommunication] Found 2 versions of android-support-v4.jar in the dependency list,
[2013-02-03 11:34:45 - HANCommunication] but not all the versions are identical (check is based on SHA-1 only at this time).
[2013-02-03 11:34:45 - HANCommunication] All versions of the libraries must be the same at this time.
[2013-02-03 11:34:45 - HANCommunication] Versions found are:
[2013-02-03 11:34:45 - HANCommunication] Path: D:\facebook-android-sdk-3.0\facebook-android-sdk-3.0\facebook\libs\android-support-v4.jar
[2013-02-03 11:34:45 - HANCommunication]    Length: 349252
[2013-02-03 11:34:45 - HANCommunication]    SHA-1: 612846c9857077a039b533718f72db3bc041d389
[2013-02-03 11:34:45 - HANCommunication] Path: D:\workspace\space\HANCommunication\libs\android-support-v4.jar
[2013-02-03 11:34:45 - HANCommunication]    Length: 385685
[2013-02-03 11:34:45 - HANCommunication]    SHA-1: 48c94ae70fa65718b382098237806a5909bb096e
[2013-02-03 11:34:45 - HANCommunication] Jar mismatch! Fix your dependencies

我的 list :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.radzik.hancommunication"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="16" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.radzik.hancommunication.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

我尝试更改目标 API 版本,但这对我没有帮助。

谢谢

最佳答案

检查应用程序项目文件夹中的 libs 目录。如果那里有 android-support-v4.jar,这就是错误的原因。 Facebook SDK 已经包含了这个 jar 的一个版本,但显然它们不匹配。我通过从我的应用程序项目中删除该 jar 解决了这个问题。

我怀疑不匹配的原因是 android SDK jar 自开发 SDK 以来已更新。

关于facebook-android-sdk - 导入 FacebookSDK 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14671688/

相关文章:

facebook-android-sdk - 如何在 Facebook SDK 4.0.1 (Android) 中获取 Facebook 用户电子邮件

android - 使用 Android 设计支持库中的 float 操作按钮实现 float 操作菜单

android - NotificationCompat 和 API 检查

java - Facebook Messenger Android Sdk 共享 setExternalUri

java - "Cannot resolve symbol ` Facebook Graph API 请求 `"错误

android - 如何设置 PreferenceFragmentCompat 的样式

android - 无法将编译 'com.android.support:design:27.0.2' 添加到 The Build Gradle

java - 忽略 AndroidX 并希望在 Android Studio 3.2 中单独使用 android 支持库

android - Android SDK :How facebook check the Hash key?

android - 如何在 Android 中管理 facebook 权限