Android facebook sdk import error
Asked Answered
G

5

7

i had download facebook skd import it in my eclipse add v4 jar file and change complier to 1.6 but yet it give me error in class FacebookAppLinkResolver

import bolts.AppLink; import bolts.AppLinkResolver; import bolts.Continuation; import bolts.Task;

enter image description here above are not import

Gainly answered 10/5, 2014 at 16:57 Comment(0)
F
9

1.Open your project properties

2.Select "Java Build Path" from left side menu

3.Select "Libraries" tab

4.Press "Add External Jar"

5.MOST IMPORTANT STEPS :- Select "bolts" jar file of "libs" folder of YOUR CURRENT PROJECT LOCATION(Path Should be
of your project only and not the android sdk).

6.Select "Order and Export" tab and "TICK" the checkbox of "android-support-v4.jar"

Filmdom answered 22/5, 2014 at 10:38 Comment(0)
G
8

Download sdk for Bolts library from https://github.com/BoltsFramework/Bolts-Android and add this project with facebook sdk project.

Gwynethgwynne answered 11/5, 2014 at 20:52 Comment(0)
F
7

Or if you're using Gradle you can add this to your Gradle file:

dependencies {
    compile 'com.parse.bolts:bolts-android:1.1.3'
}

Facebook is also available so you don't have to add that manually either. To include both use the following:

dependencies {
    compile 'com.facebook.android:facebook-android-sdk:4.5.0'
    compile 'com.parse.bolts:bolts-android:1.1.3'
}

You can check for the latest version of Bolts here.

Faille answered 3/11, 2014 at 13:44 Comment(0)
R
0

amalBit's answer works great for Eclipse. Here is the Android Studio equivalent. I encountered this error after updating to the latest Facebook SDK for Android.

  1. File ->
  2. Project Structure ->
  3. Select the Facebook module on the left
  4. Select the Dependencies tab
  5. Press the + button at the bottom of the window
  6. Select File Dependency
  7. In the libs folder, you should see the bolts.jar file you copied over when updating the SDK.
  8. Select the bolts.jar file and press OK
  9. Then press Apply and OK

Doing a Gradle Sync (happened automatically for me) should resolve the error.

Rumal answered 13/8, 2014 at 16:25 Comment(0)
C
0

I had the same problem. Check your facebook-sdk/facebook folder to see if there is a libs file (Not directory)

So I think Android studio failed to import the libs as a directory instead included a libs file with "../libs" in it. Not sure if this was facebook-sdk issue, git cloning issue or android studio issue.

Solution:
1. remove the dummy libs file
2. copy the libs directory manually
3. remove the dependency in project structure
4. add it manually by clicking + sign

Cleistogamy answered 3/9, 2014 at 21:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.