Android OpenCV - no .so files in /lib directories - android

I have spent days at this point compiling and re-compiling different versions of OpenCV to be used in Android apps.
I don't get any compiler errors, and I'm following all the steps in the tutorials.
But no .so files are getting generated and being placed in the /lib folder
Any ideas?

Do you work with eclipse? Which /lib folder do you mean?
the android/android-opencv/libs folder or
a specific folder from the included samples e.g. android/apps/CVCamera/libs folder?
Did you build OpenCV AND android-opencv AND the specific project without errors? You should check this first.
For a first shot I would suggest you to build a project from the included samples (e.g. the "CVCamera" project). In my folder structure it looked like this:
$cd somepath/OpenCV-2.3.0/android/apps/CVCamera
$sh project_create.sh
$ant compile
If this does not work then follow the error messages or post them here. Perhaps I can help you.
Good luck,
gartenabfall

Related

gradle does not add native libraries from fresco

i want to add fresco to my project so according to official site i put
compile 'com.facebook.fresco:fresco:0.9.0+'
into my gradle file. but after running the apk it fails on UnsatisfiedLinkError. i looked into my .apk and there is no /lib folder that should contain its .so files. i found out on the internet that gradle doesn't support .so files but i have seen projects that got it actually working, so there must be a way.
thanks in advance

Facebook Conceal .so files not uploading in Android Project

I cannot get the Conceal Library to work, it may be something I am doing wrong, I wish the instructions were a bit more detailed.
http://facebook.github.io/conceal/documentation/
I have added the crypto.jar to my project, and then the instructions tell me to add the files armeabi/*.so to my jni folder.
"Add a dependency to crypto.jar from java code using your favorite dependency management system, and drop the .so files in libs.zip into your jni/ folder."
I don't have a jni folder, since my project is a normal Android progect, not an NDK project. How can I get this to work, I tried creating the folder and adding it to the build path, but it did not work. I am completely lost on this. In my source code I am loading the libraries like this:
static {
// Load Facebook Conceal Crypto Files
System.loadLibrary("libconceal.so");
System.loadLibrary("libcryptox.so");
}
then the instructions tell me to add the files armeabi/*.so to my jni folder.
That's a bug in their documentation. Pre-compiled .so files will go in libs/. So, you should wind up with libs/armeabi/*.so.
I tried creating the folder and adding it to the build path
That is almost never the right answer and can seriously screw things up, so I recommend that you reverse that step.

'Conversion to Dalvik format failed with error 1' and 'java.lang.IllegalArgumentException: already added: '

I'm having this problem since I installed the new SDKs. I've read about this happening when I try to link the same class to the build twice.
But here is the peculiar thing about it:
I have an Android library project that includes a class folder on the build path.
I have this library project included in one of my regular Android projects.
I have to include the class folder in this regular project as well to make it build.
This when the error occurs.
But when I do either of the following:
Remove the class folder from the library project: The library project won't build, so the regular project won't either.
Remove the class folder from the regular project: The library project builds, but the regular project won't because it misses the class files (?!).
I seem to be stuck in some unsolvable paradigm here.
Maybe there are build rules to circumvent this?
Any help would be greatly appreciated!
Apparently the way Android library projects are linked has changed.
Before, the library's source folder would be linked to the build path.
With the new solution the library is apparently built to a jar file in its own 'bin' folder.
This is then linked as an external jar to the build path of the project using the library.
To make the conflict dissappear, do two things:
Remove the source folder link in Project properties->Java Build Path->Source
Clean the project. Perhaps clear your projects 'bin' folder manually.
Now it should work again! :)

Adding prebuilt library to android apk

I have built a dynamic library in android using android build system. This library provides jni interface for functions inside it. Now I want to include this library in an application (.apk). I am using eclipse for application development. Now, how can I use the prebuild dynamice library (.so) in my application ? I tried putting it in a lib folder in my application but it is not working.
Any pointers are appreciated.
I am not using ndk to build my .so.
Since you write 'so' I think you're using NDK. If you're using NDK I don't know the answer.
If you're using the "Java" SDK, then in your library project go to Properties -> Android, and Check "Is Library". In your "apk" project, go to Properties -> Android -> Add . And your Library project should be available.
Also, any Library added in the "Java Build Path" Menu (again, in project properties) should be available in the APK in the end.
I know it's slightly old, but have you checked in the built APK to see if your .so library is there? Should be in the libs/armeabi folder.
Also, your .so file should be in lib/armeabi folder in your eclipse solution. I'm guessing the armeabi bit depends on which processor your .so file is build for.
Also, I know that if your library isn't called lib[name].so, it won't get copied when the apk is installed on the device. So:
libfoo.so copies
foo.so doesn't copy
foo.so doesn't copy
Also, you can use DDMS (its a view in eclipse) and it's file explorer to see if it's been copied to your device. It should be under data/data/[packagename]/lib.
Hope this helps a bit!
Andy.
I hit this same problem while building Qiqqa for Android. Under your eclipse android project, make sure you have a libs directory (not that it is plural libS not singular lib). Inside that create the armeabi/etc subdirs with their respectibe .so files.
Then when you build, eclipse will automatically pick up this libs directory and create the corresponding lib in your apk. System.loadLibrary("XXX") will then resolve to libXXX.so on your correct architecture...
Cheers,
Jimme

How do I add the JJIL libraries to my Android Eclipse project?

I'm trying to use the JJIL libraries with my Android project:
http://code.google.com/p/jjil/
I followed all the instructions on importing libraries into eclipse on the android guides, and have had no successes. It just fails to import.
Can some one point me in the right direction with this?
Cheers,
Nick D
I recommend you download the source and add it to your project. A lot of compiled .jars won't work in Android because they contain stuff that needs to be converted to the Dalvik format. Just download the source from their google code repository and copy it into the /src folder of your project (with the whole com/whatever/whatever/ directory structure, too). The next time you start Eclipse, the source for those libraries should be in your project and building.

Categories

Resources