9

Using Eclipse. SDK Manager is up to date. How ever when I import the facebook SDK to my workspace. It throws lots of error.

facebook-android-sdk-4.0.0\facebook\res\values\messenger_button_styles.xml:66: error: Error: No resource found that matches the given name: attr 'android:textAllCaps'. I removed it from values.

The import android.support cannot be resolved I added support v4 '<>' operator is not allowed for source level below 1.7 If i change the complier it gives kitkat below error. When I do insert inferred type arguments It goes away. Afterwards it gives bolts library error. Then I downloaded bolts and import it too. How ever this time bolts gives a lots of that I can't fixed further. Any suggestions for it.

4 Answers 4

7

The Facebook Android SDK v4.0 uses Gradle as it's build and dependency management system. http://marketplace.eclipse.org/content/gradle-integration-eclipse-44 is available for Eclipse. Also http://eclipse.org/m2e/ can be used for integrating with the Facebook's maven artifact: http://search.maven.org/#artifactdetails|com.facebook.android|facebook-android-sdk|4.0.0|

The android:textAllCaps issue occurs if you're targeting a version smaller than API 15. This doesn't cause a build issue in Gradle, and the lint warning is suppressed as it's ignored in API versions < 15.

2
  • I imported project as a gradle project and i also installed the plugins in the links above. Everything is OK. However i could not handle the use library as project import. It add facebook and gradle folders to my project and some gradle files like "settings.gradle", "build.gradle", "gradlew" etc. But i cant import com.facebook to use in my activity. Any walkthrough about gradle integration on existing android project. Thnx Mar 31, 2015 at 11:22
  • If your project is converted to Gradle, you don't need to import the Facebook SDK by code any more, just add a compile dependency to it as described in the 4th and 5th steps: developers.facebook.com/docs/android/getting-started/… So remove all the Facebook SDK code, and add: repositories { mavenCentral() } dependencies { compile 'com.facebook.android:facebook-android-sdk:4.0.0' } To the build.gradle of your app. Mar 31, 2015 at 17:10
4

I, too, downloaded the Facebook 4.0.0 SDK over the weekend and I had a lot of errors:

I did the following as we did when I installed 3.23.1: 1. Right click on the new Facebook project (the one you imported) and hilight the Android Tools, then select Add Support Library. 2. Clean the project

Here comes the key part: 3. It seems like 4.0.0 does not come w/ the bolts' jar file. You can import the bolts-1.1.2.jar as an external library from the older version of the Facebook SDK. Let me know if you need detail on how to do that. Hope this helps and good luck!

2
  • It can be done with that however I need the use v4.0 for messenger purposes and older SDK does not have this. Thanks Mar 30, 2015 at 5:54
  • Sorry for the confusion. You can still use 4.0.0, but just import the bolts-1.1.2.jar from 3.23.1 as the external jar.
    – Johnny Wu
    Mar 31, 2015 at 6:03
3

Follow it for the eclipse it's a best solution

  1. goto this url and dowload the zip of it gith hub
  2. then extract the zip and open the folder facebook-android-sdk-master a libs folder is inside. copy that folder and paste it to facebook sdk root

Now import that into eclipse and right click on it in eclipse and follow the next step

  1. Now select facebook sdk and change it's compile API to 4.4 or >

  2. Now go to src>com.facebook> AccessToken inside it HashSet/ArrayList and cursor show you the suggestion to change it to jre 1.7 just do it.

Success

1

I faced the same problem with latest Facebook SDK 4.6.0

I solve it following the next steps:

  1. add to AndroidManifest.xml this code <uses-sdk android:minSdkVersion="15"/> or higher.
  2. From project > Properties > Android > choose Android 4.4.2 to solve problem of compilation with java 1.7
  3. Create folder libs at your project folder then copy android-support-v4.jar from ../android-sdk-linux/extras/android/support/v4 to libs
  4. Download bolts.jar from that link : https://github.com/BoltsFramework/Bolts-Android
  5. Copy bolts-android-ver.jar to libs
  6. Clean your project.

Enjoy ... I hope this is helpful for you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.