VLC For Android Ubuntu14.04 build the compiling environment, androidubuntu14.04

Source: Internet
Author: User

VLC For Android Ubuntu14.04 build the compiling environment, androidubuntu14.04

VLC multimedia player (English: VLC media player, originally named VideoLAN Client, is an open-source multimedia player planned by VideoLAN .) Supports multiple audio and video decoder and file formats, as well as DVD, VCD, and various stream protocols. It is an open source and supports multiple platforms.

Official Website: https://wiki.videolan.org/AndroidCompile#Get_VLC_Source

Environment:

HOST: Windows XP

Virtual Machine: VirtualBox-4.3.12-93733-Win.exe

Virtual Machine System: ubuntu14.04

Environment setup requirements:
On Linux, I installed Ubuntu14.04
Tools to be installed:
Apache-ant (or ant), autoconf, automake, autopoint, cmake, gawk (or nawk), gcc, g ++, libtool, git,
M4, patch, pkg-config, ragel, subversion, unzip.
Tip:
1. If you are compiling a Android-x86 device, you should install yasm

I. Android SDK
1. Create a directory named android_tools
2. Go to the official website to download the latest SDK http://developer.android.com/sdk/index.html
3. decompress the package to the android directory.
4. Run: tools/android (you can also run: "tools/android update sdk-u-t platform, platform-tool, extra ")
5. Install "SDK Platform Android 4.3, API 18" in the tool directory. Follow the prompts to perform the operation.
Note: The target = android-18 of the project. properties project of the VLC project must have been installed. Otherwise, question 3 is reported:

Ii. Android NDK
1. Make sure that the SDK has been installed successfully. NDK requires r9 or later, because it has been configured in the compile. sh file. if the version is too low, You will be prompted: You need the NDKv9 or later
2. Download NDK for Linux http://developer.android.com/intl/zh-cn/tools/sdk/ndk/index.html
3. decompress the package to the android_tools directory to ensure that the SDK and SDK are in the same directory.

When installing the SDK and NDK, be sure to check whether the machine is 64-bit or 32-bit. Download the corresponding version for installation. Otherwise, some inexplicable problems may occur.
Both the SDK and NDK are installed under the current directory android_tools.
Dzt @ dzt-VirtualBox :~ /Android_tools $ sudo tar-xvf/mnt/shared/android-ndk-r9d-linux-x86.tar.bz2
Dzt @ dzt-VirtualBox :~ /Android_tools $ sudo unzip/mnt/shared/adt-bundle-linux-x86-20140702.zip

3. Configure Environment Variables

Environment setup
In ~ /. Add sudo gedit ~ to bashrc ~ /. Bashrc
Export ANDROID_SDK =/home/dzt/android_tools/adt-bundle-linux-x86_64-20140321/sdk
Export ANDROID_NDK =/home/dzt/android_tools/android-ndk-r9d
Export PATH = $ PATH: $ ANDROID_SDK/platform-tools: $ ANDROID_SDK/tools
Write according to the actual installation path

Set the environment variable equivalent:
Dzt @ dzt-VirtualBox :~ /Android_tools $ sudo source ~ /. Bashrc

Devices specifies the device in the command line. This is not configured in the file. You need to reset the device after each compilation and exit.
Root @ dzt-VirtualBox:/home/dzt/android_vlc/android # export ANDROID_ABI = armeabi
Root @ dzt-VirtualBox:/home/dzt/android_vlc/android # export NO_FPU = 1



Iv. Compilation
1. Get VLC Source
Run the following command in the previously created android directory:
Git clone git: // git.videolan.org/vlc-ports/android.git
2. Compile
Run: sh compile. sh
Root @ dzt-VirtualBox:/home/dzt/android_vlc/android # sh compile. sh
For an ARMv6 device without FPU:
$ Export NO_FPU = 1
For an ARMv5 device:
$ Export NO_ARMV6 = 1

If you plan to use a release build, run 'compile. sh release'
VLC source not found, cloning
Cloning to 'vlc '...
Remote: Counting objects: 426425, done.
Remote: Compressing objects: 100% (80869/80869), done.
Remote: Total 426425 (delta 343977), reused 425830 (delta 343585)
Received objects: 100% (426425/426425), 237.54 MiB | 201.00 KiB/s, done.
Processing delta: 100% (343977/343977), done.
Check connection... complete.
Checking out files: 100% (3413/3413), done.
Switch to a new branch 'android'
Building tools


I downloaded r9d.
You need to update the compile. sh file. If the NDK version is too low or too high, You will be prompted: You need the NDKv9 or later
Modify the compile. sh file.
Root @ dzt-VirtualBox:/home/dzt/android_vlc/android # gedit compile. sh


# Try to detect NDK version
REL = $ (grep-o '^ r [0-9] *. *' $ ANDROID_NDK/RELEASE. TXT 2>/dev/null | cut-b2 -)
Echo $ REL // print the publication
Case "$ REL" in
9 | 9 *) # modify this line
GCCVER = 4.8
CXXSTL = "/" $ {GCCVER}
;;
7 | 8 | *)
Echo "You need the NDKv9 or later"
Exit 1
;;
Esac


Download related libraries: http://download.videolan.org/pub/contrib/can be accessed, I used VPN

Dependent libraries. These libraries will be downloaded during compilation, but may fail to be downloaded. In this case, you need to manually download them and copy them to this directory.

dzt@dzt-VirtualBox:~/android_vlc/android/vlc/contrib/tarballs$ lsa52dec-0.7.4.tar.gz       libebml-1.3.0.tar.bz2      LibVNCServer-0.9.9.tar.gzffmpeg-2763179.tar.gz     libgcrypt-1.6.1.tar.bz2    libvorbis-1.3.4.tar.xzflac-1.3.0.tar.xz         libgpg-error-1.13.tar.bz2  libxml2-2.9.1.tar.gzfreetype-2.5.3.tar.gz     libgsm_1.0.13.tar.gz       live.2014.05.27.tar.gzfribidi-0.19.6.tar.bz2    libiconv-1.14.tar.gz       nettle-2.6.tar.gzgmp-6.0.0.tar.bz2         libmad-0.15.1b.tar.gz      openjpeg-1.5.0.tar.gzgnutls-3.1.25.tar.xz      libmatroska-1.4.1.tar.bz2  opus-1.1.tar.gzjpegsrc.v9a.tar.gz        libmodplug-0.8.8.5.tar.gz  postproc-git.tar.gzlibass-0.11.2.tar.gz      libmpeg2-0.5.1.tar.gz      speexdsp-git.tar.gzlibdvbpsi-1.2.0.tar.bz2   libogg-1.3.2.tar.xz        speex-git.tar.gzlibdvdcss-1.2.13.tar.bz2  libpng-1.6.12.tar.xz       taglib-1.9.1.tar.gzlibdvdnav-git.tar.xz      libssh2-1.4.3.tar.gz       zlib-1.2.8.tar.gzlibdvdread-4.9.9.tar.bz2  libtheora-1.1.1.tar.xz
Above Library: http://pan.baidu.com/s/1jGJukq6

Sort out problems encountered during compilation

Question 1
=== Processing ing in gettext-runtime (/home/dzt/android_vlc/android/vlc/contrib-android-arm-linux-androideabi/gettext-runtime)
Configure: running/bin/bash. /configure -- disable-option-checking '-- prefix =/home/dzt/android_vlc/android/vlc/contrib/arm-linux-androideabi ''-- datarootdir =/home/dzt/ android_vlc/android/vlc/contrib/arm-linux-androideabi/share ''-- includedir =/home/dzt/android_vlc/android/vlc/contrib/arm-linux-androideabi/include ''-- libdir =/home/dzt/android_vlc/android/vlc/contrib/arm-linux-androideabi/lib'' -- build = i686-linux-gnu'' -- host = arm-linux- androideabi ''-- target = arm-linux-androideabi'' -- program-prefix = ''-- enable-static'' -- disable-shared ''-- disable-dependency-tracking'' -- with-pic ''-- disable-java'' -- disable-native-java ''-- without-emacs'' build _ alias = i686-linux-gnu ''host _ alias = arm-linux -androideabi ''target _ alias = arm-linux-androideabi ''CC = arm-linux-androideabi-gcc -- sysroot =/home/dzt/android_vlc/android/android-ndk-r9d/platforms/ android-9/arch-arm ''CFLAGS =-g-mfpu = vfpv3-d16-mcpu = cortex-a8-mthumb-mfloat-abi = softfp-O2-I/home/dzt/android_vlc/ android/android-ndk-r9d/sources/cxx-stl/gnu-libstdc ++/4.8/include-I/home/dzt/android_vlc/android/android-ndk-r9d/sources/cxx-stl/gnu- libstdc ++/4.8/libs/armeabi-v7a/include-I/home/dzt/android_vlc/android/vlc/contrib/arm-linux-androideabi/include-g'' LDFLAGS =- l/home/dzt/android_vlc/android/vlc/contrib/arm-linux-androideabi/lib ''CPPFLAGS =-g-mfpu = vfpv3-d16-mcpu = cortex-a8-mthumb-mfloat- abi = softfp-O2-I/home/dzt/android_vlc/android/android-ndk-r9d/sources/cxx-stl/gnu-libstdc ++/4.8/include-I/home/dzt/ android_vlc/android/android-ndk-r9d/sources/cxx-stl/gnu-libstdc ++/4.8/libs/armeabi-v7a/include-I/home/dzt/android_vlc/android/vlc/contrib/ arm-linux-androideabi/include ''CXX = arm-linux-androideabi-g ++ -- sysroot =/home/dzt/android_vlc/android/android-ndk-r9d/platforms/android-9/ arch-arm ''CXXFLAGS =-g-mfpu = vfpv3-d16-mcpu = cortex-a8-mthumb-mfloat-abi = softfp-O2-I/home/dzt/android_vlc/android/android-ndk-r9d/ sources/cxx-stl/gnu-libstdc ++/4.8/include-I/home/dzt/android_vlc/android/android-ndk-r9d/sources/cxx-stl/gnu-libstdc ++/ 4.8/libs/armeabi-v7a/include-I/home/dzt/android_vlc/android/vlc/contrib/arm-linux-androideabi/include-G' -- cache-file =/dev/ null -- srcdir =.
Checking for a BSD-compatible install.../usr/bin/install-c
Checking whether build environment is sane... yes
Checking for arm-linux-androideabi-strip... arm-linux-androideabi-strip
Checking for a thread-safe mkdir-p.../bin/mkdir-p
Checking for gawk... no
Checking for mawk... mawk
Checking whether make sets $ (MAKE)... yes
Checking whether make supports nested variables... yes
Checking for arm-linux-androideabi-gcc... arm-linux-androideabi-gcc -- sysroot =/home/dzt/android_vlc/android/android-ndk-r9d/platforms/android-9/arch-arm
Checking whether the C compiler works... no
Configure: error: in '/home/dzt/android_vlc/android/vlc/contrib-android-arm-linux-androideabi/gettext-runtime ':
Configure: error: C compiler cannot create executables
See 'config. log' for more details
Configure: error:./configure failed for gettext-runtime
Make: *** [. gettext] Error 77

Fix:
Because of my 32-bit machine, I used 64-bit software and changed the SDK and NDK to 32-bit.


Question 2:
Checking whether byte ordering is bigendian... no
Checking for pthread_create in-lpthread... no
Configure: error: pthread needed
Make: *** [. dvdna v] Error 1

Fix:
I did not report this error after downloading it again.
I was
Step 1 git clone git: // git.videolan.org/vlc-ports/android.git
This problem was reported only after the subsequent tasks were done. After I deleted all the tasks, I followed the steps above and performed quite smoothly.

Question 3:
-Set-mode-check:

-Set-debug-files:

-Check-env:
[Checkenv] Android SDK Tools Revision 23.0.2
[Checkenv] Installed at/home/dzt/android_tools/adt-bundle-linux-x86-20140702/sdk

-Setup:
[Echo] Project Name: VLC
[Gettype] Project Type: Application

-Set-debug-mode:

-Debug-obfuscation-check:

-Pre-build:

-Build-setup:
[Getbuildtools] Using latest Build Tools: 255.0.0
[Echo] Resolving Build Target for VLC...

BUILD FAILED
/Home/dzt/android_tools/adt-bundle-linux-x86-20140702/sdk/tools/ant/build. xml: 542: Unable to resolve project target 'android-19'

Total time: 6 seconds
Make: *** [vlc-android/bin/VLC-debug.apk] Error 1
Rm android-libs/libmedia. c android-libs/libutils. c android-libs/libstagefright. c android-libs/libbinder. c
Root @ dzt-VirtualBox:/home/dzt/android_vlc/android #


Fix:
Error cause
BUILD FAILED
/Home/dzt/android_tools/adt-bundle-linux-x86-20140702/sdk/tools/ant/build. xml: 542: Unable to resolve project target 'android-19'
Because I have not installed the "android-19" SDK,
There are two solutions:
1. Modify the project property file vlc-android/project. properties
# This file is automatically generated by Android Tools.
# Do not modify this file -- your changes will be erased!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "Ant. properties", and override values to adapt the script to your
# Project structure.

# Project target.

Target = android-18
Android. library. reference.1 = ../java-libs/appcompat
Android. library. reference.2 = ../java-libs/SlidingMenu
Android. library. reference.3 = ../java-libs/WheelView

2. Install the "android-19" SDK and run the following command:
Root @ dzt-VirtualBox:/home/dzt/android_tools/adt-bundle-linux-x86-20140702/sdk # tools/android

The following figure shows how to download the SDK you need, but not all of them can be downloaded, because google cannot be connected recently, you know



Question 4:
BUILD FAILED
/Home/dzt/android_tools/adt-bundle-linux-x86-20140702/sdk/tools/ant/build. xml: 601: The following error occurred while executing this line:
/Home/dzt/android_tools/adt-bundle-linux-x86-20140702/sdk/tools/ant/build. xml: 542: Unable to resolve project target 'android-19'

Total time: 11 seconds
Make: *** [vlc-android/bin/VLC-debug.apk] Error 1
Rm android-libs/libmedia. c android-libs/libutils. c android-libs/libstagefright. c android-libs/libbinder. c

Fix:
Modify the SDK package according to the SDK package you have installed.
Android/vlc-android/project. properties
There is also a java-libs directory. It is best to find out and modify all android-x, including AndroidManifest. xml files.
Dzt @ dzt-VirtualBox :~ /Android_vlc/android/java-libs $ find./-name project. properties
./SlidingMenu/project. properties
./WheelView/project. properties
./Appcompat/project. properties

Android/java-libs/SlidingMenu/project. properties
Android/java-libs/WheelView/project. properties
Android-x in the android/java-libs/appcompat/project. properties file,
But for the vlc-android0.0.5 version must be 4.0 and above version (because 0.0.5 version of the interface needs 4.0 and above features) So here must be 14 and above,
Otherwise, error: Error retrieving parent for item: No resource found that matches the given name 'android: Widget. Holo. actionbar' will be reported '.

The compilation only requires the interface features of the 4.0 package, but does not affect the running target of the final generated APK (as long as the 4.0 and above APIs are not called). For example, I am here in AndroidManifest. you can set
<Uses-sdk android: minSdkVersion = "7" android: targetSdkVersion = "18"/> to run the compilation command again.

If an error is reported, it is recommended that you install the SDK as simple as possible.

Summary:
There are many problems encountered during the compilation process. If you have any problems, you can check Baidu first to see if other people have encountered similar situations. Generally, you can find answers online. You need to analyze the specific problems, if you cannot find the steps you want to perform on your website;
There is no way to try it several times by step.


What are the prompts for vlc for linux?

Vlc cannot run with root. If you need real-time priority or privileged port, you can use vlc-wrapper
 
Help to build an Android environment in Ubuntu

You can go to the folder to see if there is any resource file and then try again ..

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.