简体   繁体   English

Facebook SDK无法在Android Studio上运行

[英]Facebook SDK is not working on Android Studio

I have follow Scott Barta solution to import Facebook SDK on the new version of Android Studio ( here ) but now i'm having trouble using this sdk. 我遵循Scott Barta解决方案在新版本的Android Studio上导入Facebook SDK( 这里 ),但现在我在使用这个sdk时遇到了麻烦。

When I import import com.facebook.android.Facebook; 当我导入import com.facebook.android.Facebook; I can't run my apps, it keeps reporting error: package com.facebook.android does not exist and all my methods that refer to facebook are "deprecated". 我无法运行我的应用程序,它一直报告error: package com.facebook.android does not exist ,我所有引用facebook的方法都被“弃用”。

Does anyone know where this could come? 有谁知道这可能来到哪里?

I have been facing similar issues with the latest Facebook SDK update, if you're using Gradle, I'll strongly recommend you, to first try to do a Gradle Sync as you can see here: 我一直面临着最新Facebook SDK更新的类似问题,如果您使用的是Gradle,我强烈建议您首先尝试进行Gradle Sync,如下所示:

https://stackoverflow.com/a/19932896/799162 https://stackoverflow.com/a/19932896/799162

If that doesn't work ( as my case) you can force gradle to download your dependencies as shown here: 如果这不起作用(如我的情况),您可以强制gradle下载您的依赖项,如下所示:

https://stackoverflow.com/a/13567793/799162 https://stackoverflow.com/a/13567793/799162

as an extra thing to do, try to do a clean on your build. 作为额外的事情,尝试清理你的构建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM