2

I am trying to use Facebook login in my App with the Facebook library in Android Studio.

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:

 *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.

Ojonugwa Jude Ochalifu
  • 26,627
  • 26
  • 120
  • 132
JoCuTo
  • 2,463
  • 4
  • 28
  • 44

2 Answers2

16

If you imported the library via File > Import Module, Android Studio copied that facebook directory into your project. The $PROJECT_ROOT/facebook/build.gradle file references 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. In your project, you need to point at the libs folder in the facebook library folder. Change .. to . as below:

dependencies {
    compile files('./libs/bolts.jar')
    compile 'com.android.support:support-v4:19.+'
}
MeanderingCode
  • 452
  • 5
  • 8
  • Thanks. I have just do it and when I trying to do the imports on my class , for example import com.facebook.LoggingBehavior, I have this new error Error: package com.facebook does not exist – JoCuTo Jun 27 '14 at 17:58
  • 1
    In mi case works with this dependencies { compile 'com.android.support:support-v4:13.0.+' compile files('/libs/bolts.jar') } – JoCuTo Jun 27 '14 at 22:47
0

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.

See my detailed post here

Community
  • 1
  • 1
Stephen Vinouze
  • 1,815
  • 1
  • 17
  • 28