同步发表于http://avenwu.net/2015/07/27/vlc-android-compiling

安装必备工具/解决环境问题

环境准备什么的如果没配置过需要一步步配置,主要是sdk/ndk,以及一些编译过程中需要用到的命令工具。

* Requirements

You MUST build on Linux (or OSX if you know what you are doing).
The following packages MUST must be installed:
* the GNU autotools: autoconf, libtool, automake and make (a.k.a. gmake)
* ...and their dependencies: m4 and gawk, mawk or nawk,
* the GNU C and C++ compilers a.k.a. gcc and g++,
* some GNU build utilities: pkg-config and patch,
* the following other build utilities: Apache Ant (or Ant), cmake, protobuf, ragel,
* the Subversion and Git version control systems
* unzip and either curl or wget for retreiving sources.
* Very recent versions of some of those tools may be required. At the time of writing, notably gettext 0.19.3 or later is required.
If any of the above is missing, expect the build to fail at some point.
If targeting an Android-x86 device, yasm must be installed too.

特别要注意gettext的版本问题,系统如果自带了可能版本不一致,比如笔者的时0.18.3,这个时候可以进行升级,可利用port,如果原版本是用homebrew安装的则也可以通过brew升级,但是port安装的不能通过brew升级,这样的操作会导致本地安装一个新的gettext,并未覆盖原有的版本

port upgrade outdated

获取源码/编译

接着开始获取源代码,尝试编译;

获取源代码

git clone git://git.videolan.org/vlc-ports/android.git vlc-android

很遗憾第一次失败了:

aven-mac-pro:vlc-android aven$ ./compile.sh
*** No ANDROID_ABI defined architecture: using ARMv7
Downloading gradle
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
Archive: gradle-2.2.1-all.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
note: gradle-2.2.1-all.zip may be a plain executable, not an archive
unzip: cannot find zipfile directory in one of gradle-2.2.1-all.zip or
gradle-2.2.1-all.zip.zip, and cannot find gradle-2.2.1-all.zip.ZIP, period.

错误处理

从异常信息来看应该是gradle-2.2.1-all.zip文件无效,导致文件校验失败。可以手工检测下gradle文件的内容:

aven-mac-pro:vlc-android aven$ unzip -l gradle-2.2.1-all.zip
Archive: gradle-2.2.1-all.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
note: gradle-2.2.1-all.zip may be a plain executable, not an archive
unzip: cannot find zipfile directory in one of gradle-2.2.1-all.zip or
gradle-2.2.1-all.zip.zip, and cannot find gradle-2.2.1-all.zip.ZIP, period.

果然失败,目测应该是网络下载文件失败,尝试翻墙后重新下载,或从其他项目拷贝一份,gradle官网罗列了所有可供下载的版本:https://services.gradle.org/distributions

下载完毕后解压为gradle/*,和AndroidStudio的格式保持一致,这个就是用来生成AndroidStudio配置使用的;

接下来脚本会自动尝试下载vlc源码,若有本地已有vlc源码可以拷贝一份vlc,因为下载比较慢

再次编译,遇到protobuf的缺失问题,port或brew安装之;

protoc not found
To-be-built packages: protoc
rm -f -R protobuf && tar xvjf protobuf-2.6.0.tar.bz2
mv protobuf-2.6.0 protobuf && touch protobuf
mv: rename protobuf-2.6.0 to protobuf: No such file or directory
make: *** [protobuf] Error 1
buildsystem tools: make

安装过程最好保持翻墙状态,否则容易出现个别地址无法访问,例如amazon的云服务

(7) Failed to connect to s3.amazonaws.com port 443: Operation timed out

解决完错误,继续编译,看到这段输出时基本也就大功告成:

make: Entering directory `/Users/aven/work/video/vlc-android/libvlc'
[armeabi-v7a] Gdbserver : [arm-linux-androideabi-4.8] libs/armeabi-v7a/gdbserver
[armeabi-v7a] Gdbsetup : libs/armeabi-v7a/gdb.setup
[armeabi-v7a] Install : libanw.10.so => libs/armeabi-v7a/libanw.10.so
[armeabi-v7a] Install : libanw.13.so => libs/armeabi-v7a/libanw.13.so
[armeabi-v7a] Install : libanw.14.so => libs/armeabi-v7a/libanw.14.so
[armeabi-v7a] Install : libanw.18.so => libs/armeabi-v7a/libanw.18.so
[armeabi-v7a] Install : libanw.21.so => libs/armeabi-v7a/libanw.21.so
[armeabi-v7a] Install : libiomx.10.so => libs/armeabi-v7a/libiomx.10.so
[armeabi-v7a] Install : libiomx.13.so => libs/armeabi-v7a/libiomx.13.so
[armeabi-v7a] Install : libiomx.14.so => libs/armeabi-v7a/libiomx.14.so
[armeabi-v7a] Compile thumb : vlcjni <= libvlcjni.c
[armeabi-v7a] SharedLibrary : libvlcjni.so
[armeabi-v7a] Install : libvlcjni.so => libs/armeabi-v7a/libvlcjni.so
make: Leaving directory `/Users/aven/work/video/vlc-android/libvlc' //省略部分 :vlc-android:processVanillaARMv7DebugManifest UP-TO-DATE
:vlc-android:processVanillaARMv7DebugResources UP-TO-DATE
:vlc-android:generateVanillaARMv7DebugSources UP-TO-DATE
:vlc-android:processVanillaARMv7DebugJavaRes UP-TO-DATE
:vlc-android:compileVanillaARMv7DebugJava UP-TO-DATE
:vlc-android:compileVanillaARMv7DebugNdk UP-TO-DATE
:vlc-android:compileVanillaARMv7DebugSources UP-TO-DATE
:vlc-android:preDexVanillaARMv7Debug
:vlc-android:dexVanillaARMv7Debug
:vlc-android:validateDebugSigning
:vlc-android:packageVanillaARMv7Debug
:vlc-android:zipalignVanillaARMv7Debug
:vlc-android:assembleVanillaARMv7Debug BUILD SUCCESSFUL Total time: 23.73 secs

检查并安装demo:

aven-mac-pro:vlc-android aven$ ls -al vlc-android/build/outputs/apk/
total 53856
drwxr-xr-x 4 aven staff 136 Aug 1 12:34 .
drwxr-xr-x 4 aven staff 136 Aug 1 12:34 ..
-rw-r--r-- 1 aven staff 13785101 Aug 1 12:34 VLC-Android-1.5.0-ARMv7.apk
-rw-r--r-- 1 aven staff 13783961 Aug 1 12:34 vlc-android-vanilla-ARMv7-debug-unaligned.apk aven-mac-pro:vlc-android aven$ adb install vlc-android/build/outputs/apk/VLC-Android-1.5.0-ARMv7.apk
5836 KB/s (13785101 bytes in 2.306s)
pkg: /data/local/tmp/VLC-Android-1.5.0-ARMv7.apk
Success

检验成果

运行demo,功能还是很强大的,基本上就是一个完善的播放器,还支持一些实用的功能,比如倍速播放;



参考文档

vlc android 移植版编译的更多相关文章

  1. 第一章 Android系统的编译和移植实例

    第一章 Android系统的编译和移植实例 这一章节主要介绍了Android系统的编译和移植技术,作为建立在Linux内核的基础上的Android操作系统,它的编译和移植不论在过程还是技术方面都和嵌入 ...

  2. Ubuntu15.10 编译VLC Android(安卓)过程记录

    持续更新中... 最后一次修改于 2016-03-20 15:33:45 1.必要库的安装 除基本编译环境(gcc.g++等外),需要额外安装如下的库(用于下载必要的依赖文件) (1)JDK 推荐安装 ...

  3. 【转】vlc android 代码编译

    转自:http://blog.csdn.net/asircao/article/details/7734201 系统:ubuntu12.04代码:git://git.videolan.org/vlc- ...

  4. 在android中,编译的项目使用到第三方jar的导入方法 终极版!

    1,在android系统环境中编译自己的项目时,往往会用到第三方jar包.这些jar包在eclipse中加入编译,一路畅通,由于eclipse已经帮助你配置好了.可是当把这个项目复制到系统环境中编译时 ...

  5. android源码编译1

    一.环境说明: 1.liunx系统:Ubuntu12.04 2.jdk:sun-java6-jdk 3.g++4.5 gcc4.5 二.android源码的目录结构 |-- Makefile |-- ...

  6. 【转】高通平台android 环境配置编译及开发经验总结

    原文网址:http://blog.csdn.net/dongwuming/article/details/12784535 1.高通平台android开发总结 1.1 搭建高通平台环境开发环境 在高通 ...

  7. 初学者的Android移植:在Debian上建立一个稳定的构建环境

    介绍 通过在chrooted环境中设置开发环境,避免依赖冲突和沙箱您的Android开发从您的Debian GNU/Linux系统.这是为通配符类别准备的,因为从源代码构建Android似乎没有在其他 ...

  8. Ogre 1.9 Android移植

    Ogre 1.9 Android移植 分类: 图形渲染2013-02-04 16:47 3860人阅读 评论(14) 收藏 举报 Android Ogre C++linuxLinuxLINUX 上一篇 ...

  9. mir9-lua——《热血沙城》45度ARPG手游-Lua移植版

    mir9——<热血沙城>,是9秒论坛开源的一个使用Cocos2d-x-2.2.1引擎开发的45度ARPG手游Demo,源代码为c++.mir9-lua是mir9的Lua移植版,使用Quic ...

随机推荐

  1. 我的复杂的OpenCV编译之路(OpenCV3.1.0 + VS2010 + Win7)

    教程:www.cnblogs.com/jliangqiu2016/p/5597501.html 这里主要记载我编译遇到的错误及解决方法. OpenCV3.1软件下载:https://sourcefor ...

  2. Android--Content Provider

    1.内容提供器(Content Provider)主要用于在不同的应用程序之间实现数据共享的功能,它提供了一套完整的机制,允许一个程序访问另一个程序中的数据,同时还能保证被访数据的安全性. 2.内容提 ...

  3. ORACLE修改用户表所属表空间的步骤

    ORACLE修改用户表所属表空间的步骤 使用脚本进行修改.据目前所了解,正长情况下需要修改表的空间和表的索引的空间,如果涉及到BOLB字段的表,修改的方式又不一样了!正常情况下的修改脚本:1.修改表的 ...

  4. 微软BI 之SSIS 系列 - 在 SQL 和 SSIS 中实现行转列的 PIVOT 透视操作

    开篇介绍 记得笔者在 2006年左右刚开始学习 SQL Server 2000 的时候,遇到一个面试题就是行转列,列转行的操作,当时写了很长时间的 SQL 语句最终还是以失败而告终.后来即使能写出来, ...

  5. 【转】Asp.Net MVC及Web API框架配置会碰到的几个问题及解决方案

    前言 刚开始创建MVC与Web API的混合项目时,碰到好多问题,今天拿出来跟大家一起分享下.有朋友私信我问项目的分层及文件夹结构在我的第一篇博客中没说清楚,那么接下来我就准备从这些文件怎么分文件夹说 ...

  6. 一起来花5分钟写一个PHP入门Demo

    最近公司招了几个应届毕业生,他们对前端的了解还挺多,但是对后端的技术一无所知,我觉得,作为一个前端攻城狮,如果你有远大的抱负,就应该雨露均沾... 今天我就跟大家讲一讲PHP最基本的入门,至少别人问起 ...

  7. [ACM_模拟] UVA 10881 Piotr's Ants[蚂蚁移动 数组映射 排序技巧]

    "One thing is for certain: there is no stopping them;the ants will soon be here. And I, for one ...

  8. [游戏学习26] MFC 时间函数 画图形

    >_<:这里第一次介绍MFC的时间函数,功能和Win32里的计时器类似. >_<:这里还介绍了MFC的图形绘制函数,和Win32有一点区别 >_<:ABC.h #d ...

  9. OpenWrt资料汇总

    上周末折腾了一下OpenWrt,打算把Facebook的网络模拟工具部署到上面,最终以失败告终.上github看,发现已经有人给作者提了issue,作者表示部署在OpenWrt上会很有用,但确实在Op ...

  10. 将Eclipse代码导入到AndroidStudio的两种方式

    版权声明: 欢迎转载,但请保留文章原始出处 作者:GavinCT 出处:http://www.cnblogs.com/ct2011/p/4183553.html 说到使用AndroidStudio,除 ...