Android VLC Compilation Summary

Source: Internet
Author: User
Tags android sdk manager

Recently in a project need an Android app can play multi-channel video, but also need to have video, screenshot function. After researching multiple scenarios, choose to migrate VLC player. Need to be on Linux (I use Ubuntu 14. 10) under compiling VLC for Android source code, according to the official wiki, as well as the steps of their actual operation, summarized as follows:

It is important to note that the process of compiling is normal user rights and does not require root privileges.

1. Installation Tools
sudo apt-get install gcc g++ ant autoconf automake autopoint cmake gawk libtool m4 patch pkg-config protobuf-c*

Some 32-bit libraries also need to be installed on 64-bit systems

sudo dpkg --add-architecture i386sudo apt-get updatesudo apt-get install zlib1g:i386 libstdc++6:i386 libc6:i386

On some old Ubuntu systems, you also need to install Ia32-libs

sudo apt-get install ia32-libs
2. Installing VLC dependent libraries
sudo apt-get build-dep vlc
3. Install the Android SDK and NDK

Sdk:http://developer.android.com/sdk/index.html
Ndk:http://developer.android.com/tools/sdk/ndk/index.html
If the download speed is slow, you can also select a domestic mirror, such as: (http://mirrors.neusoft.edu.cn/android/repository/)

3,1 After you install the farm, you need to add environment variables
//编辑文件  ~/.bashrc 或者 /etc/profile//在文件尾部添加以下三句话  export ANDROID_SDK=/path/to/android-sdk  export ANDROID_NDK=/path/to/android-ndk  export PATH=$PATH:$ANDROID_SDK/platform-tools:$ANDROID_SDK/tools//然后通过以下命令是环境变量生效source  ~/.bashrc或者 source /etc/profile
3.2 Update SDK

The appropriate version of the SDK is required for subsequent compilation of the APK, so you will need to follow the new SDK when the environment variable is in effect and execute the command at the terminal

android

Start the Android SDK Manager to download the appropriate version of the SDK, I am compiling the SDK version 20 is downloaded.

4. Get VLC Android source
git clone git://git.videolan.org/vlc-ports/android.git

Set the compiled platform, the general mobile phone is the armeabi-v7a platform.

export ANDROID_ABI=armeabi-v7a

Start compiling

sh compile.sh

After executing the command, download some third-party source code and tools. Some of the library's URL is not accessible, you have to find a way to put into the "Vlc/contrib/tarballs" directory, and then re-execute the compilation command.

In order to facilitate everyone, I will download their own third-party library uploaded to the Baidu cloud, if the network is not good can be placed directly under the Vlc/contrib/tarballs folder. This greatly speeds up the compilation. Http://pan.baidu.com/s/1bnhTzZ5

4. Problems encountered during compilation troubleshooting 64-bit Ubuntu running ADT missing libstdc++.so.6 and libz.so.1 file Error 1:

Adb:error while loading shared libraries:libstdc++.so.6:cannot open Shared object file:no such file or directory
' adb version ' failed!
Failed to parse the output of ' adb version ':

Workaround:

sudo apt-get install lib32stdc++6
Error 2:

Adt-bundle-linux-x86_64-20140702/sdk/build-tools/android-4.4w/aapt:error while loading shared libraries:libz.so.1: Cannot open shared object File:no such file or directory

Workaround:

sudo apt-get install lib32z1
Error downloading Gradle

When compiling VLC for Android, the following error occurred:

No Android_abi defined architecture:usingArmv7downloading gradle% total% Received% xferd Average speed time time Dload Upload Total spent -   354   -   354    0     0    455      0 --:--:----:---:----:--:--455archive:gradle-2.2. 1-all.zip end- of-central-DirectorySignature notFound. Either thisfileIs not  aZipFile,or itconstitutes OneDisk of aMulti-part archive. Inch theLatter Case  theCentralDirectory  andZipFile comment'll be found on   the  LastDisk (s) ofThis archive.unzip:cannot find ZipFileDirectory inch  One  ofgradle-2.2. 1-all.ziporgradle-2.2. 1-all.zip.zip, andCannot find gradle-2.2. 1-all.zip.zip, period.

Workaround Modify compile.sh at line Bayi:

${GRADLE_URL2>/dev/null || curl -O${GRADLE_URL${GRADLE_URL2>/dev/null || curl -O -L${GRADLE_URL}
GetText version is too low issue
//下载 gettext-0.16.1.tar.gz 然后执行解压,执行下属命令安装。./configuremakemake installcan solve this problem.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android VLC Compilation Summary

Related Article

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.