Appcompat and Facebook libraries conflict? - android

I have some trouble to use the Facebook SDK. In my app I use the Appcompat library for the actionbar and other stuff. When I'm now trying to include the Facebook SDK library like shown in the image below, my project suddenly gets errors everywhere.
(source: fiedlers.info)
Basically it seems like the Appcompat library is not included anymore, activities that don't use Appcompat don't have any problems.
Thanks for your help!

As #Itzik Samara said the problem was, that the AppCompact library was included twice, once in its own project folder and once as part of the Facebook SDK. These two files need to have the same MD5 hash, meaning have to be exactly the same. So I just copied the appcompat v7 file from the Appcompat project and overwrote the file in the libs folder of the Facebook SDK.

Related

Can't add support library for CardView to my project

I would like to add the support library for Cardview to my project (I am using Eclipse). I found this TUTORIAL on Android website. I am doing everything according to it (I've already succesfully added AppCompat library to the project this way), but I am stuck at fourth point of adding this particular library to my project. In the window in which I should see the CardView library there is nothing:
What am I doing wrong?
The Library Project you need to import in Eclipse (via Import->Existing Android Code into Workspace) is located in your Android SDK folder: Android\android-sdk\extras\android\support\v7\cardview

Android project suddenly full of errors because of different supporting librarys

So i wanted to add a facebook SDK to my android projects, the outcome was this:
I've decided to "undo" changes first so i removed the facebook library from my project
after:
The error is "R cannot be resolved", if im importing android's R it wont recognise the layouts anymore
for example:
My libs are:
I've tried removing support v4/v13 but neither helped. Im clueless, please help.
Copy/Paste the same latest v4 library in all the projects,

NoClassDefFoundError in facebook integeration

I am using facebook integration API in my code. I have created sha1 key for Facebook,I got my APIID ,but the problem is that when I am trying to add facebook library in my project it's adding fine ,but when I am running it, its giving me NoClassDefFoundError error and library is not adding properly, where am I doing wrong?
Here is the image:
Here my facebook library is not adding properly, What should I do ?
Your facebook SDK library project and your Current Android project both should be in same directory. Try moving your facebook sdk library to your project's folder then it will 100% work properly.
For future reference always remember that your library project must me in same folder where your appliction is.
Try this:
Go to Project/Properties/Java Build Path/Order and Export -- Make sure there's a check in front of Android Dependencies and the support library, if you use it.Mark all checkboxes and Click on Apply and clean the project.
Hope this helps.
Move your Facebook SDK library to your project's work space then it will 100% work properly.I think they both are not in the same directory , and you are suggested to check the other imports of any other project of your work space and put the Facebook SDK same as the others.

Android Studio: dx.bat failed

I am using Android Studio for building an application, in which I am using Facebook-SDK and Actionbar Sherlock as a dependencies. Each project library contains android-support-v4.jar.
When I am trying with any one of the project library it is working well. But I'm facing problems when trying to implement both simultaneously.
I know that I am facing the problem due to android-support-v4.jar.
I want to know how to add android-support-v4.jar in an efficient way.
\Android\android-studio\sdk\build-tools\android-4.2.2\dx.bat failed
I just solved the similar problem. On my case and most probably on your case also, the problem is on adding android-support-v4.jar for multiple times. I then remove the dependencies of android-support-v4.jar from my project's build.gradle and just have a single dependencies on facebook build.gradle, as facebook sdk was first to build on my project.
I faced this problem yesterday. I got it to work by making sure that there is the same android-support-v4.jar file in all libs directories throughout the project. The facebook-sdk and ABS ship with versions that might not be current when compared to the one that is installed by default by Android Studio. Let me know if it works.
If you need help integrating libraries in Android Studio, I recommend looking at facebook-sdk's step by step tutorial. I am sure once you integrate facebook-sdk you can use those steps to add any other library that you need by making small changes (i.e. use the name of the library you are trying to add instead of facebooksdk on the settings.gradle and build.gradle)

Problems using ViewPager Example

I'm an android newbie trying to use the ViewPager control which is part of the "Compatibility Package."
I first used the SDK manager to install the Extras Support Package.
I then went to https://github.com/commonsguy/cw-omnibus/tree/master/ViewPager/Fragments and got the ViewPager project and loaded it into Eclipse.
I then added a libs folder to the project and put "android-support-v4.jar" into that directory.
I did a Clean build and got all sorts of errors. The screenshot of my project is at http://dl.dropbox.com/u/39662979/viewpager.jpg.
What have I faild to do?
thanks,
Gary Blakely
I have seen that you are using part of SherlockActionBar but the missing themes had to be referred to a miss library. In particular you have to import as a library project the Jake Wharthon's work and then link to your project as android library.
Delete the Theme or add the theme to your styles.xml.
I do think you don't need the Theme if you only try to use ViewPager.
So delete it.
You might be looking for ActionBarSherlock - FAQs.
There is a video that will help You get started with the library
P.S. don't forget to delete import android.R; if You have it

Categories

Resources