简体   繁体   English

Android Studio导入facebook库奥德赛

[英]Android Studio import facebook library odyssey

I am trying to use Facebook login in my App with the Facebook library in Android Studio. 我试图在我的应用程序中使用Facebook登录Android Studio中的Facebook库。

After following 9 tutorials about how to import that library on Android Studio 0.6.1 , all was going well (on the last tutorial) before click on clean project, after click on it I am getting this error: 在关注如何在Android Studio 0.6.1上导入该库的9个教程之后,在点击清洁项目之前一切顺利(在上一个教程中),点击它之后我收到此错误:

 *C:\Users\Demetria\AndroidStudioProjects\Test\libreries\facebook\src\com\facebook\FacebookA    ppLinkResolver.java
Error:(21, 13) error: package bolts does not exist   
Error:(37, 49) error: cannot find symbol class AppLinkResolver        
Error:(57, 12) error: cannot find symbol class Task          
Error:(63, 42) error: cannot find symbol class Continuation             
Error:(105, 83) error: cannot find symbol variable Task               
Error:(192, 27) error: package AppLink does not exist*

Could anyone help me please?. 有人可以帮我吗?
Thanks in advance. 提前致谢。

If you imported the library via File > Import Module , Android Studio copied that facebook directory into your project. 如果您通过“ File > Import Module导入库,则Android Studio会将该facebook目录复制到项目中。 The $PROJECT_ROOT/facebook/build.gradle file references bolts.jar : $PROJECT_ROOT/facebook/build.gradle文件引用bolts.jar

dependencies {
    compile files('../libs/bolts.jar')
    compile 'com.android.support:support-v4:19.+'
}

Note that in the unziped archive from Facebook, there is a libs folder in the parent folder (the .. path) of the library. 请注意,在Facebook的unziped存档中, libs的父文件夹( ..路径)中有一个libs文件夹。 In your project, you need to point at the libs folder in the facebook library folder . 在您的项目中,您需要指向facebook库文件中的 libs文件 Change .. to . 改变... as below: 如下:

dependencies {
    compile files('./libs/bolts.jar')
    compile 'com.android.support:support-v4:19.+'
}

To build successfully the latest Facebook SDK with Android Studio, you also need to indicate to the build.gradle from the Facebook SDK to compile the bolt jar. 要使用Android Studio成功构建最新的Facebook SDK,您还需要从Facebook SDK指示build.gradle来编译bolt jar。

See my detailed post here 在这里查看我的详细信息

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

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