Problems With Compiling VLC on Android

VLC for Android and Chrome OS specific usage questions
shahab_sh
New Cone
New Cone
Posts: 4
Joined: 30 Nov 2012 20:03

Problems With Compiling VLC on Android

Postby shahab_sh » 30 Nov 2012 23:13

I'm writing an android app which needs a media player (over rtsp) and after a lot of research I found that the best way to this is to compile the VLC app and start from there.
I've been trying to compile VLC on android. I followed "wiki.videolan.org/AndroidCompile" but didn't succeed.
Here is what I've done:

I'm using Kubuntu 12.10 and Eclipse juno (maybe irrelevant at this point)
All the packages mentioned in the AndroidCompile page are installed.

Code: Select all

shahab@maloos{~}: echo $ANDROID_SDK /home/shahab/android-sdks/ shahab@maloos{~}: echo $ANDROID_NDK /home/shahab/android-ndk-r8b/ shahab@maloos{~}: echo $ANDROID_ABI x86 shahab@maloos{~}: echo $PATH /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/shahab/android-sdks//platform-tools:/home/shahab/android-sdks//tools shahab@maloos{~}: cd workspace/android/ shahab@maloos{~/workspace/android}: sh compile.sh
I don't see any error messages.
I uploaded the output of compile.sh here:
https://www.dropbox.com/s/s2867xttwu2o3 ... output.txt

The AndroidCompile page says that by now I should have an autogenerated debug apk in the bin/ folder. There is no bin/ folder in ~/workspace/android/ and there is no *.apk file *anywhere*. I thought if it has compiled correctly at least there should be some *.so files:

Code: Select all

shahab@maloos{~/workspace/android}: find . -name "*.apk" shahab@maloos{~/workspace/android}: find . -name "*.so" ./vlc/contrib/android/iconv/preload/.libs/libiconv.so ./vlc/contrib/android/iconv/preload/preloadable_libiconv.so ./vlc/contrib/i686-linux-android/lib/preloadable_libiconv.so
one more thing, in ~/workspace/android/ there is a script named gen-env.sh that supposedly generates a file named env.txt into vlc-android/assets/ and this script gets called by the make file. But there is no env.txt and in the output of compile.sh there is no mention of gen-env.sh

Anyway, I imported the vlc-android project into eclipse. Running it on its own of course doesn't work first I get an exception which can be fixed if I manually run gen-env.sh but then I get an error saying it couldn't load libvlcjni

So I tried to compile the native code.

Code: Select all

shahab@maloos{~/workspace/android}: cd vlc-android/ shahab@maloos{~/workspace/android/vlc-android}: ~/android-ndk-r8b/ndk-build Gdbserver : [x86-4.6] libs/x86/gdbserver Gdbsetup : libs/x86/gdb.setup make: *** No rule to make target `jni/..//modules/codec/omxil/iomx.cpp', needed by `obj/local/x86/objs-debug/iomx-gingerbread/__//modules/codec/omxil/iomx.o'. Stop.
I checked the Android.mk file and turns out VLC_SRC_DIR is not set. So:

Code: Select all

shahab@maloos{~/workspace/android/vlc-android}: export VLC_SRC_DIR=../vlc/ shahab@maloos{~/workspace/android/vlc-android}: ~/android-ndk-r8b/ndk-build Gdbserver : [x86-4.6] libs/x86/gdbserver Gdbsetup : libs/x86/gdb.setup Compile++ x86 : iomx-gingerbread <= iomx.cpp jni/../../vlc//modules/codec/omxil/iomx.cpp:27:41: fatal error: media/stagefright/OMXClient.h: No such file or directory compilation terminated. make: *** [obj/local/x86/objs-debug/iomx-gingerbread/__/__/vlc//modules/codec/omxil/iomx.o] Error 1
I don't know what to do next. Am I doing something wrong? because these things haven't been mentioned in AndroidCompile. It just says run "sh compile.sh", import project into eclipse then run & enjoy!

I'd appreciate any help... I've been spending hours trying to get this to work.
Thanks :)

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: Problems With Compiling VLC on Android

Postby edwardw » 01 Dec 2012 03:35

Install the 'yasm' package and run 'sh compile.sh' again. Also, I've updated AndroidCompile with this information.

shahab_sh
New Cone
New Cone
Posts: 4
Joined: 30 Nov 2012 20:03

Re: Problems With Compiling VLC on Android

Postby shahab_sh » 01 Dec 2012 19:02

Thank you for the quick response Edward. It compiled correctly (maybe?) but now it crashes as soon as I start the VLC app
Here is what I got from LogCat:

Code: Select all

12-01 17:49:30.408: D/AndroidRuntime(975): Shutting down VM 12-01 17:49:30.408: W/dalvikvm(975): threadid=1: thread exiting with uncaught exception (group=0x40a70930) 12-01 17:49:30.418: E/AndroidRuntime(975): FATAL EXCEPTION: main 12-01 17:49:30.418: E/AndroidRuntime(975): java.lang.RuntimeException: Unable to instantiate application org.videolan.vlc.VLCApplication: java.lang.ClassNotFoundException: Didn't find class "org.videolan.vlc.VLCApplication" on path: /data/app/org.videolan.vlc-2.apk 12-01 17:49:30.418: E/AndroidRuntime(975): at android.app.LoadedApk.makeApplication(LoadedApk.java:504) 12-01 17:49:30.418: E/AndroidRuntime(975): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4364) 12-01 17:49:30.418: E/AndroidRuntime(975): at android.app.ActivityThread.access$1300(ActivityThread.java:141) 12-01 17:49:30.418: E/AndroidRuntime(975): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294) 12-01 17:49:30.418: E/AndroidRuntime(975): at android.os.Handler.dispatchMessage(Handler.java:99) 12-01 17:49:30.418: E/AndroidRuntime(975): at android.os.Looper.loop(Looper.java:137) 12-01 17:49:30.418: E/AndroidRuntime(975): at android.app.ActivityThread.main(ActivityThread.java:5039) 12-01 17:49:30.418: E/AndroidRuntime(975): at java.lang.reflect.Method.invokeNative(Native Method) 12-01 17:49:30.418: E/AndroidRuntime(975): at java.lang.reflect.Method.invoke(Method.java:511) 12-01 17:49:30.418: E/AndroidRuntime(975): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 12-01 17:49:30.418: E/AndroidRuntime(975): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 12-01 17:49:30.418: E/AndroidRuntime(975): at dalvik.system.NativeStart.main(Native Method) 12-01 17:49:30.418: E/AndroidRuntime(975): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.videolan.vlc.VLCApplication" on path: /data/app/org.videolan.vlc-2.apk 12-01 17:49:30.418: E/AndroidRuntime(975): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65) 12-01 17:49:30.418: E/AndroidRuntime(975): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 12-01 17:49:30.418: E/AndroidRuntime(975): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 12-01 17:49:30.418: E/AndroidRuntime(975): at android.app.Instrumentation.newApplication(Instrumentation.java:968) 12-01 17:49:30.418: E/AndroidRuntime(975): at android.app.LoadedApk.makeApplication(LoadedApk.java:499) 12-01 17:49:30.418: E/AndroidRuntime(975): ... 11 more
I get this message whether I use x86 or armeabi (with NO_ARMV6 for emulator). I'm using android SDK 4.2 (API 17).
If it helps:

Code: Select all

shahab@maloos{~/workspace/android}: find . -name "VLCApplication.class" ./vlc-android/bin/classes/org/videolan/vlc/VLCApplication.class
Just a little suggestion, since the compile.sh doesn't produce any error messages if something fails due to a program missing (e.g. yasm) you might want to mention in the AndroidCompile that at the end we should get the "BUILD SUCCESSFUL" message.

EDIT: I'm using Eclipse Juno and ADT 21

shahab_sh
New Cone
New Cone
Posts: 4
Joined: 30 Nov 2012 20:03

Re: Problems With Compiling VLC on Android

Postby shahab_sh » 20 Dec 2012 21:39

In case anyone is interested, I solved the problem a few days ago...
Actually this is kinda embarrassing... in Eclipse instead of Import existing android project, I selected Import existing project.

VirMarGu
Blank Cone
Blank Cone
Posts: 12
Joined: 22 Nov 2012 17:48

Re: Problems With Compiling VLC on Android

Postby VirMarGu » 06 Feb 2013 17:18

Hi, I have explained my problem in other post. But I have read this post and my problem is like that shanab_sh says.
I execute 'sh compile.sh' and I get a message that says: BUILD SUCCESSFUL

But my problem is that I don't know how can I compile JNI source code in Eclipse Juno, when I modify a class of the JNI folder.
I have created a 'New Builder' following these guidelines: http://mobilepearls.com/labs/ndk-builder-in-eclipse\, but I get the following message in my console:
/home/vmg/workspace/android/android-ndk-r8c/build/core/add-application.mk:128: Android NDK: WARNING: APP_PLATFORM android-9 is larger than android:minSdkVersion 7 in ./AndroidManifest.xml
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
make: *** No rule to make target `jni/..//modules/codec/omxil/iomx.cpp', needed by `obj/local/armeabi/objs-debug/iomx-gingerbread/__//modules/codec/omxil/iomx.o'. Stop.

Also, when I run the application VLC for Android in the LogCat output I get this lines:

02-06 17:05:24.980: E/ResourceType(4151): Style contains key with bad entry: 0x010102ce
02-06 17:05:24.988: I/global(4151): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
02-06 17:05:24.988: I/global(4151): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
02-06 17:05:24.996: W/VLC/LibVLC(4151): Unable to load the iomx library: java.lang.UnsatisfiedLinkError: Library iomx-gingerbread not found
02-06 17:05:24.996: E/VLC/LibVLC(4151): Can't load vlcjni library: java.lang.UnsatisfiedLinkError: Library vlcjni not found

Please, help!

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: Problems With Compiling VLC on Android

Postby edwardw » 07 Feb 2013 12:24

Don't use the Eclipse builder. You have to use follow the AndroidCompile page as linked above.

VirMarGu
Blank Cone
Blank Cone
Posts: 12
Joined: 22 Nov 2012 17:48

Re: Problems With Compiling VLC on Android

Postby VirMarGu » 07 Feb 2013 13:51

Thanks for the reply.

I have followed the guidelines of that page (http://wiki.videolan.org/AndroidCompile) and have got a project in Eclipse with the source code. When I run this project, it installs on the device correctly.
But my problem is that I want to modify the classes .c of the JNI folder and run this project and that the changes performe correctly. I have changed some things and when I run the application, it hasn't got those changes.

I want to know how can I compile the project in Eclipse and that the changes of these class, that are written in C language, take effect.

THanks!

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: Problems With Compiling VLC on Android

Postby edwardw » 07 Feb 2013 13:57

But my problem is that I want to modify the classes .c of the JNI folder and run this project and that the changes performe correctly. I have changed some things and when I run the application, it hasn't got those changes.
This has nothing to do with Eclipse.

VirMarGu
Blank Cone
Blank Cone
Posts: 12
Joined: 22 Nov 2012 17:48

Re: Problems With Compiling VLC on Android

Postby VirMarGu » 07 Feb 2013 14:06

Thanks, again!
I have to compile the classes .c, for these changes take effect. I try to compile the class libvlcjni.c from the terminal and this is what I get:

vmg@bakio:~/workspace/android/android/vlc-android/jni$ ls
Android.mk eventfd.c pthread-condattr.c utils.h
aout.c libvlcjni.c pthread-once.c wchar
aout.h libvlcjni.h pthread-rwlocks.c
Application.mk log.h sem.c
egl-android-info.txt pipe2.c thumbnailer.c
vmg@bakio:~/workspace/android/android/vlc-android/jni$ gcc libvlcjni.c
libvlcjni.c:29:21: fatal error: vlc/vlc.h: No such file or directory
compilation terminated.

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: Problems With Compiling VLC on Android

Postby edwardw » 08 Feb 2013 17:01

Change directory back to the root of VLC for Android (~/workspace/android/android/), and try this:

Code: Select all

source ./env.sh make distclean -e make -e

VirMarGu
Blank Cone
Blank Cone
Posts: 12
Joined: 22 Nov 2012 17:48

Re: Problems With Compiling VLC on Android

Postby VirMarGu » 11 Feb 2013 14:57

Thanks for the reply!

I have modified the libvlcjni.c class with the following change:
#define LOG_TAG "VLC/JNI/Vir/main" instead of #define LOG_TAG "VLC/JNI/main" to see if the trace output has the new LOG_TAG.

And I have tried it:
source ./env.sh
make distclean -e
make -e

This is the message of output in the terminal:

Code: Select all

vmg@bakio:~/workspace/android/android/vlc-android/jni$ ls Android.mk eventfd.c pthread-condattr.c utils.h aout.c libvlcjni.c pthread-once.c wchar aout.h libvlcjni.h pthread-rwlocks.c Application.mk log.h sem.c egl-android-info.txt pipe2.c thumbnailer.c vmg@bakio:~/workspace/android/android/vlc-android/jni$ gcc libvlcjni.c libvlcjni.c:29:21: fatal error: vlc/vlc.h: No such file or directory compilation terminated. vmg@bakio:~/workspace/android/android/vlc-android/jni$ cd .. vmg@bakio:~/workspace/android/android/vlc-android$ cd .. vmg@bakio:~/workspace/android/android$ source ./env.sh vmg@bakio:~/workspace/android/android$ make distclean -e cd vlc-android && rm -rf gen libs obj bin vlc-android/bin/VLC-debug.apk rm -rf java-libs/*/gen java-libs/*/bin rm -f android-libs/*.so android-libs/*.c rm -f vlc-android/obj/local/armeabi-v7a/libvlcjni.so vlc-android/obj/local/armeabi-v7a/libiomx-ics.so vlc-android/obj/local/armeabi-v7a/libiomx-hc.so vlc-android/obj/local/armeabi-v7a/libiomx-gingerbread.so vlc-android/jni/libvlcjni.h vmg@bakio:~/workspace/android/android$ make -e Generating vlc-android/jni/libvlcjni.h Generating android-libs/libstagefright.c Generating android-libs/libstagefright.so Generating android-libs/libmedia.c Generating android-libs/libmedia.so Generating android-libs/libutils.c Generating android-libs/libutils.so Generating android-libs/libbinder.c Generating android-libs/libbinder.so === Building libvlcjni === make[1]: Entering directory `/home/vmg/workspace/android/android/vlc-android' Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi-v7a/gdbserver Gdbsetup : libs/armeabi-v7a/gdb.setup Compile++ thumb : iomx-gingerbread <= iomx.cpp StaticLibrary : libstdc++.a SharedLibrary : libiomx-gingerbread.so Install : libiomx-gingerbread.so => libs/armeabi-v7a/libiomx-gingerbread.so Compile++ thumb : iomx-hc <= iomx.cpp SharedLibrary : libiomx-hc.so Install : libiomx-hc.so => libs/armeabi-v7a/libiomx-hc.so Compile++ thumb : iomx-ics <= iomx.cpp SharedLibrary : libiomx-ics.so Install : libiomx-ics.so => libs/armeabi-v7a/libiomx-ics.so Compile thumb : vlcjni <= libvlcjni.c In file included from jni/libvlcjni.c:30:0: .././vlc/include/vlc_common.h: In function 'vlc_memalign': .././vlc/include/vlc_common.h:834:5: warning: implicit declaration of function 'posix_memalign' [-Wimplicit-function-declaration] Compile thumb : vlcjni <= aout.c Compile thumb : vlcjni <= thumbnailer.c Compile thumb : vlcjni <= pthread-condattr.c Compile thumb : vlcjni <= pthread-rwlocks.c Compile thumb : vlcjni <= pthread-once.c Compile thumb : vlcjni <= eventfd.c Compile thumb : vlcjni <= sem.c Compile thumb : vlcjni <= pipe2.c Compile thumb : vlcjni <= wcpcpy.c Compile thumb : vlcjni <= wcpncpy.c Compile thumb : vlcjni <= wcscasecmp.c Compile thumb : vlcjni <= wcscat.c Compile thumb : vlcjni <= wcschr.c Compile thumb : vlcjni <= wcscmp.c Compile thumb : vlcjni <= wcscoll.c Compile thumb : vlcjni <= wcscpy.c Compile thumb : vlcjni <= wcscspn.c Compile thumb : vlcjni <= wcsdup.c Compile thumb : vlcjni <= wcslcat.c Compile thumb : vlcjni <= wcslcpy.c Compile thumb : vlcjni <= wcslen.c Compile thumb : vlcjni <= wcsncasecmp.c Compile thumb : vlcjni <= wcsncat.c Compile thumb : vlcjni <= wcsncmp.c Compile thumb : vlcjni <= wcsncpy.c Compile thumb : vlcjni <= wcsnlen.c Compile thumb : vlcjni <= wcspbrk.c Compile thumb : vlcjni <= wcsrchr.c Compile thumb : vlcjni <= wcsspn.c Compile thumb : vlcjni <= wcsstr.c Compile thumb : vlcjni <= wcstok.c Compile thumb : vlcjni <= wcswidth.c Compile thumb : vlcjni <= wcsxfrm.c Compile thumb : vlcjni <= wmemchr.c Compile thumb : vlcjni <= wmemcmp.c Compile thumb : vlcjni <= wmemcpy.c Compile thumb : vlcjni <= wmemmove.c Compile thumb : vlcjni <= wmemset.c SharedLibrary : libvlcjni.so /home/vmg/workspace/android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: cannot find -ldca collect2: ld returned 1 exit status make[1]: *** [obj/local/armeabi-v7a/libvlcjni.so] Error 1 make[1]: Leaving directory `/home/vmg/workspace/android/android/vlc-android' make: *** [vlc-android/obj/local/armeabi-v7a/libvlcjni.so] Error 2 rm android-libs/libmedia.c android-libs/libutils.c android-libs/libstagefright.c android-libs/libbinder.c
But when I installed the application in my device, this is the message in the Log-cat output of Eclipse:

02-11 14:59:30.960: E/ResourceType(3196): Style contains key with bad entry: 0x010102ce
02-11 14:59:30.960: I/global(3196): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
02-11 14:59:30.960: I/global(3196): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
02-11 14:59:30.968: D/dalvikvm(3196): Trying to load lib /data/data/org.videolan.vlc/lib/libiomx-gingerbread.so 0x4871af10
02-11 14:59:30.976: D/dalvikvm(3196): Added shared lib /data/data/org.videolan.vlc/lib/libiomx-gingerbread.so 0x4871af10
02-11 14:59:30.976: D/dalvikvm(3196): No JNI_OnLoad found in /data/data/org.videolan.vlc/lib/libiomx-gingerbread.so 0x4871af10, skipping init
02-11 14:59:30.976: E/VLC/LibVLC(3196): Can't load vlcjni library: java.lang.UnsatisfiedLinkError: Library vlcjni not found
02-11 14:59:30.976: I/AndroidRuntime(3196): AndroidRuntime onExit calling exit(1)

Thus, the applicacion doesn't run correctly.

THanks!

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Problems With Compiling VLC on Android

Postby Jean-Baptiste Kempf » 11 Feb 2013 15:55

libvlcjni.c:29:21: fatal error: vlc/vlc.h: No such file or directory

Did not compile correctly.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

VirMarGu
Blank Cone
Blank Cone
Posts: 12
Joined: 22 Nov 2012 17:48

Re: Problems With Compiling VLC on Android

Postby VirMarGu » 11 Feb 2013 16:22

Thanks! I haven't explained correctly.

I tried to compile libvlcjni.c and I got this:

Code: Select all

vmg@bakio:~/workspace/android/android/vlc-android/jni$ gcc libvlcjni.c libvlcjni.c:29:21: fatal error: vlc/vlc.h: No such file or directory compilation terminated.
And edward answered me:
Change directory back to the root of VLC for Android (~/workspace/android/android/), and try this:

Code: Select all
source ./env.sh
make distclean -e
make -e
I tried it and the output of the terminal is as follows:

Code: Select all

vmg@bakio:~/workspace/android/android$ source ./env.sh vmg@bakio:~/workspace/android/android$ make distclean -e cd vlc-android && rm -rf gen libs obj bin vlc-android/bin/VLC-debug.apk rm -rf java-libs/*/gen java-libs/*/bin rm -f android-libs/*.so android-libs/*.c rm -f vlc-android/obj/local/armeabi-v7a/libvlcjni.so vlc-android/obj/local/armeabi-v7a/libiomx-ics.so vlc-android/obj/local/armeabi-v7a/libiomx-hc.so vlc-android/obj/local/armeabi-v7a/libiomx-gingerbread.so vlc-android/jni/libvlcjni.h vmg@bakio:~/workspace/android/android$ make -e Generating vlc-android/jni/libvlcjni.h Generating android-libs/libstagefright.c Generating android-libs/libstagefright.so Generating android-libs/libmedia.c Generating android-libs/libmedia.so Generating android-libs/libutils.c Generating android-libs/libutils.so Generating android-libs/libbinder.c Generating android-libs/libbinder.so === Building libvlcjni === make[1]: Entering directory `/home/vmg/workspace/android/android/vlc-android' Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi-v7a/gdbserver Gdbsetup : libs/armeabi-v7a/gdb.setup Compile++ thumb : iomx-gingerbread <= iomx.cpp StaticLibrary : libstdc++.a SharedLibrary : libiomx-gingerbread.so Install : libiomx-gingerbread.so => libs/armeabi-v7a/libiomx-gingerbread.so Compile++ thumb : iomx-hc <= iomx.cpp SharedLibrary : libiomx-hc.so Install : libiomx-hc.so => libs/armeabi-v7a/libiomx-hc.so Compile++ thumb : iomx-ics <= iomx.cpp SharedLibrary : libiomx-ics.so Install : libiomx-ics.so => libs/armeabi-v7a/libiomx-ics.so Compile thumb : vlcjni <= libvlcjni.c In file included from jni/libvlcjni.c:30:0: .././vlc/include/vlc_common.h: In function 'vlc_memalign': .././vlc/include/vlc_common.h:834:5: warning: implicit declaration of function 'posix_memalign' [-Wimplicit-function-declaration] Compile thumb : vlcjni <= aout.c Compile thumb : vlcjni <= thumbnailer.c Compile thumb : vlcjni <= pthread-condattr.c Compile thumb : vlcjni <= pthread-rwlocks.c Compile thumb : vlcjni <= pthread-once.c Compile thumb : vlcjni <= eventfd.c Compile thumb : vlcjni <= sem.c Compile thumb : vlcjni <= pipe2.c Compile thumb : vlcjni <= wcpcpy.c Compile thumb : vlcjni <= wcpncpy.c Compile thumb : vlcjni <= wcscasecmp.c Compile thumb : vlcjni <= wcscat.c Compile thumb : vlcjni <= wcschr.c Compile thumb : vlcjni <= wcscmp.c Compile thumb : vlcjni <= wcscoll.c Compile thumb : vlcjni <= wcscpy.c Compile thumb : vlcjni <= wcscspn.c Compile thumb : vlcjni <= wcsdup.c Compile thumb : vlcjni <= wcslcat.c Compile thumb : vlcjni <= wcslcpy.c Compile thumb : vlcjni <= wcslen.c Compile thumb : vlcjni <= wcsncasecmp.c Compile thumb : vlcjni <= wcsncat.c Compile thumb : vlcjni <= wcsncmp.c Compile thumb : vlcjni <= wcsncpy.c Compile thumb : vlcjni <= wcsnlen.c Compile thumb : vlcjni <= wcspbrk.c Compile thumb : vlcjni <= wcsrchr.c Compile thumb : vlcjni <= wcsspn.c Compile thumb : vlcjni <= wcsstr.c Compile thumb : vlcjni <= wcstok.c Compile thumb : vlcjni <= wcswidth.c Compile thumb : vlcjni <= wcsxfrm.c Compile thumb : vlcjni <= wmemchr.c Compile thumb : vlcjni <= wmemcmp.c Compile thumb : vlcjni <= wmemcpy.c Compile thumb : vlcjni <= wmemmove.c Compile thumb : vlcjni <= wmemset.c SharedLibrary : libvlcjni.so /home/vmg/workspace/android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: cannot find -ldca collect2: ld returned 1 exit status make[1]: *** [obj/local/armeabi-v7a/libvlcjni.so] Error 1 make[1]: Leaving directory `/home/vmg/workspace/android/android/vlc-android' make: *** [vlc-android/obj/local/armeabi-v7a/libvlcjni.so] Error 2 rm android-libs/libmedia.c android-libs/libutils.c android-libs/libstagefright.c android-libs/libbinder.c
I thought that the process was accomplished successfully and the libvlcjni.c class was compiled correctly, but when I installed the application in my device, this is the message in the Log-cat output of Eclipse:

Code: Select all

02-11 14:59:30.960: E/ResourceType(3196): Style contains key with bad entry: 0x010102ce 02-11 14:59:30.960: I/global(3196): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 02-11 14:59:30.960: I/global(3196): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required. 02-11 14:59:30.968: D/dalvikvm(3196): Trying to load lib /data/data/org.videolan.vlc/lib/libiomx-gingerbread.so 0x4871af10 02-11 14:59:30.976: D/dalvikvm(3196): Added shared lib /data/data/org.videolan.vlc/lib/libiomx-gingerbread.so 0x4871af10 02-11 14:59:30.976: D/dalvikvm(3196): No JNI_OnLoad found in /data/data/org.videolan.vlc/lib/libiomx-gingerbread.so 0x4871af10, skipping init 02-11 14:59:30.976: E/VLC/LibVLC(3196): Can't load vlcjni library: java.lang.UnsatisfiedLinkError: Library vlcjni not found 02-11 14:59:30.976: I/AndroidRuntime(3196): AndroidRuntime onExit calling exit(1)
I have seen that there are two errors:

Code: Select all

/home/vmg/workspace/android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: cannot find -ldca collect2: ld returned 1 exit status make[1]: *** [obj/local/armeabi-v7a/libvlcjni.so] Error 1 make[1]: Leaving directory `/home/vmg/workspace/android/android/vlc-android' make: *** [vlc-android/obj/local/armeabi-v7a/libvlcjni.so] Error 2 rm android-libs/libmedia.c android-libs/libutils.c android-libs/libstagefright.c android-libs/libbinder.c
Thus, the applicacion doesn't run correctly.

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: Problems With Compiling VLC on Android

Postby edwardw » 12 Feb 2013 04:45

You do not compile like this ('gcc libvlcjni.c"), because it is trying to invoke host GCC for a cross compile, which makes no sense.

You must use Makefiles to build VLC for Android, as it is the only way that all the variables needed are set correctly.


Return to “VLC for Android and Chrome OS”

Who is online

Users browsing this forum: No registered users and 61 guests