我可以使用“import com.facebook.FacebookSdk”与Facebook SDK 3.23.1? [英] Can I use "import com.facebook.FacebookSdk;" with Facebook SDK 3.23.1?

查看:531
本文介绍了我可以使用“import com.facebook.FacebookSdk”与Facebook SDK 3.23.1?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的app\build.gradle文件中,我有 compile'c​​om.facebook.android:facebook-android-sdk:3.23.1'。在我的BaseActivity.java文件(我有public class BaseActivity extends Activity)中,我试图使用这个: import com.facebook.FacebookSdk; 。这是我得到的错误:

In my app\build.gradle file, I have compile 'com.facebook.android:facebook-android-sdk:3.23.1'. In my BaseActivity.java file (where I have "public class BaseActivity extends Activity"), I am trying to use this: import com.facebook.FacebookSdk;. This is the error I get:

Error:(8, 20) error: cannot find symbol class FacebookSdk
Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details.

我正在使用 https://developers.facebook.com/quickstarts/ 按照向项目添加Facebook SDK的说明进行操作。其中一个步骤是:将Facebook SDK导入到应用程序,并提供以下行:

I am using https://developers.facebook.com/quickstarts/ to follow the instructions for adding Facebook SDK to a project. One of the steps is: "Import Facebook SDK into your app", and they provide the following line:

import com.facebook.FacebookSdk;

可以用Facebook SDK 3.23.1这样做吗?我想知道这些说明是否意味着使用Facebook SDK 4.0.0或更高版本。

Is it possible to do this with Facebook SDK 3.23.1? I wonder if the instructions imply the use of Facebook SDK 4.0.0 or higher.

更新:我正在复制我的依赖项。

UPDATE: I am copying my dependencies below.

dependencies {
compile 'com.google.code.gson:gson:2.2.4'
compile files('libs/AndroidSDK-2.15.9.jar')
compile files('libs/core.jar')
compile files('libs/easyfacebookandroidsdk_2.3.jar')
compile files('libs/PayPal_MPL.jar')
compile files('libs/signpost-commonshttp4-1.2.1.1.jar')
compile files('libs/signpost-core-1.2.1.1.jar')
compile files('libs/socialauth-4.2.jar')
compile files('libs/twitter4j-core-3.0.5.jar')
compile files('libs/urbanairship-lib-3.3.0.jar')
compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.facebook.android:facebook-android-sdk:3.23.1'}


推荐答案

不,import com.facebook.FacebookSdk只能从Facebook SDK 4.0获得。 0。是的,可以使用Facebook分析与Facebook SDK v3.x.我终于有Facebook分析工作使用Facebook SDK v3.23.1。我使用了AppEventsLogger类,如 https://开发人员.facebook.com / docs / reference / android / 3.23.1 / class / AppEventsLogger /

No, "import com.facebook.FacebookSdk;" is only available from Facebook SDK 4.0.0. Yes, it is possible to use Facebook Analytics with Facebook SDK v3.x. I finally have Facebook Analytics working using Facebook SDK v3.23.1. I used the AppEventsLogger class as explained at https://developers.facebook.com/docs/reference/android/3.23.1/class/AppEventsLogger/.

这篇关于我可以使用“import com.facebook.FacebookSdk”与Facebook SDK 3.23.1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆