Facebook SDK inside library project throws Dalvik error - android

I am trying to build a library which will be having some activities of it's own that will be included as a part of another Host App.
I want to integrate Facebook SDK inside this library for sharing some content. When I try to include the FB SDK as a library project and then include the library into the host app, I get the
Dalvik cache with error 1 error
while compiling the Host project.
Am I doing something wrong here?

It's hard to tell what the issue is without more information, but working with the FacebookSDK, I know I've had a similar issue.
Make sure that the support libraries, android-support-v4.jar, or whatever you're using, isn't in both your project and the FacebookSDK project. If you have to pick one or the other, put the .jar in the FacebookSDK so both projects can reference it.
Other than that, if you're using eclipse, make sure you clean 17 times, and restart eclipse a few times too. ;)

Related

Using Java SDK in Android app

So the app I'm building has to use a specific library. Unfortunately this library uses bouncycastle in it. As is known this will not work with Android. Are there any ways to get around this? I was suggested to build a service layer to interact with the library SDK but I have no idea where to begin or what that really is.
If the library comes in a packed .jar file you can import it to your Android project by right clicking on the project > Properties > Java Build Path > Libraries tab and pressing the Add external JAR button
This is valid for Eclipse, there way to do it on Android Studio might be different.
This post may also solve your issue: BouncyCastle on Android
I ended up finding and modifying the source code of the SDK to implement spongycastle

android parse sdk with Facebook sdk

I am integrating Parse sdk to my project.
I have Facebook sdk already in my project.
After i imported the parse .jars and run my project, eclipse has the following error message in Console tab (instead of LogCat tab):
Unable to execute dex: Multiple dex files define Lbolts/AggregateException;
Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lbolts/AggregateException;
I have created a fresh new project and import the 2 sdk, same errors come out.
When I take out one of them, problem gone.
Parse sdk also supports some (if I am not wrong) Facebook functions like Facebook login. But I also need Facebook sharing and I cannot find parse sdk supporting it. So I still need the native Facebook sdk.
Anyone also have the same problem? Any solution for it?...
Great thanks in advance
I figured out that if I only imported the "parse.jar" and leave the "bolts.jar" not imported, everything works fine and I did receive push notification after completing the remaining procedures from Parse website.
It also works for iOS side. Simply import Parse framework and left Bolts framework not imported.
I wonder if this is the best solution but at least it works for me
I use eclipse and I didn't see the imports..
Besucally you need to understand that the problem is that somewhere somehow there are duplicates jar file.
Usually this caused because multipul libraries that you use that have same jars files.
For me - both facebookSDk and the ParseLoginUI had bolts jar. because the ParseLoginUI uses facebookSDK library, Ieft the file only in the facebookSDK library

Trouble installing OpenCV for android

I am trying to get the OpenCV library working with android. I imported this library project into eclipse and made a new android project (the one I will develop) and just. I set the build path to include the OpenCV project in eclipse. However, when I run my new project, it says
[2014-10-13 19:41:57 - OpenCV Library - 2.4.10] Could not find OpenCV Library - 2.4.10.apk!
From what I understand, my new project should automatically pull in the library project and install it. I am wondering if I am missing any steps (because it doesn't seem to be pulling in the project)? Does it have to be the same target sdk? I am quite sure I followed all of the OpenCV installation guide and have no compile errors in the projects. Also if I load up the sample projects by directly installing the apks they seem to work fine. I even tried it with the OpenCV Manager app already installed but that didn't work either. Thanks for any help.
Just add the OpenCV library project as shown below, the problem will go.
Project -> Properties -> Android
and press OK.
You should check "Library" build option in Eclipse for OpenCV android project.(Not your project)
Clean your OpenCV library,build it again and check in OpenCv library->bin->opencv library -X.X.XX.jar if there is a file (X==> VERSION)(see picture).See this for .jar file. If this file does not exist then your library is not generated then check the video it might help This should help if your library is not built.
My personal experience:I wasn't able to generate the jar file for some reasons using OpenCv2.4.10 .If the same happens to you consider using OPENCVTEGRA library it works at least for me.
Answering 1st time. Hope this helps

Cannot use ParseLoginUI along with the Parse SDK

In my project I'm using the Parse SDK and now i want to add the ParseLoginUI library from here:
https://github.com/ParsePlatform/ParseUI-Android
I imported the library into my eclipse but i cannot use it inside my project.
Every time i try to include it as a library to my project, it gives me this error
Jar mismatch! Fix your dependencies
Any help
The problem is that the parse.jar file in the Parse SDK and in the login library are different versions. You can replace one with the other, and everything should work fine (found in the 'lib' folder). If you're using gradle to build the project, you'll need to appropriately adjust the dependencies config.
I will note that the Login UI library comes with no associated JavaDocs (and it's behind the SDK .jar by one version), so if you don't want to lose the convenient access to the docs, you should replace the .jar file in the login library with the one from the SDK, and not vice versa.
Alternatively, you can remove the parse.jar completely from you main project, and it will draw it from the loginUI library.

how to use android project library in eclipse?

I am new in android. I see a lot of android libraries out there like github.com but when I download them none of them are a *.jar file like this one:
NumberProgressBar
It seems that all these libraries are for android studio NOT eclipse (Am I correct? This is important).
My question is: How do I use these libraries in eclipse?
I tried to import the downloaded library as an android project and then mark it as "is library" and then add to my project, but that did not work.
That library is designed to be built with Gradle for Android (with or without Android Studio), producing an AAR.
Eclipse does not have native AAR support. I have published a recipe and a Ruby script to convert an AAR into a library project that Eclipse can use, though I have not tested it much.
Or, you can download the source code and attempt to reorganize it into an Eclipse-style library project.
I just downloaded it and add it as library project and everything looks fine. How do you do it, it's extremely simple. Let us know in which step you have a problem so we can figure out what is wrong.
You have to build the library first.
For your example, read the Readme file, section 'Build'.

Categories

Resources