vlc-android 的编译过程

参考官方文档:https://wiki.videolan.org/AndroidCompile#Get_VLC_Source

值得注意的的地方:

1.切记安装以下工具

sudo apt-get install automake ant autopoint cmake build-essential libtool 
     patch pkg-config protobuf-compiler ragel subversion unzip git 
    openjdk-8-jre openjdk-8-jdk

最好设置代理,应为有些包不翻墙太慢,还容易出错
2.修改

compile.sh

应为这个包有点大,翻墙也慢

最好先下载好,在本地搭建服务器,然后替换路径

如:

GRADLE_URL=http://127.0.0.1/gradle-3.4.1-bin.zip

 
貌似后面还有一次下载该文件,找不到在哪里修改路径,直接中断程序,查找零时文件发现在/root/.gradel/wrapper/dists/gradel-3.4.3-bin/xxx/下

删除原先的文件,替换为

gradle-3.4.1-bin.zip

重新运行脚本


3.记录一个错误:

make: Leaving directory `/root/AndroidStudioProjects/vlc-android/medialibrary'
Dumping dbg symbols info .dbg/armeabi-v7a
fatal: Not a git repository (or any of the parent directories): .git

FAILURE: Build failed with an exception.

* Where:
Build file '/root/AndroidStudioProjects/vlc-android/vlc-android/build.gradle' line: 203

* What went wrong:
A problem occurred evaluating project ':vlc-android'.
> Process 'command 'git'' finished with non-zero exit value 128

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.954 secs

 
google了好久还是不知道怎么解决,有人说是git下载不完全导致建议重新编译,

想想应该是最后一步了,重来代价太大,4.2G的文件又要下好久。

索性看看代码,看能怎么改一下:

def revision() {
    def code = new ByteArrayOutputStream()
    //exec {
    //    commandLine 'git', 'rev-parse', '--short', 'HEAD'
    //    standardOutput = code
    //}
    return code.toString()
}

 
应该是跟版本相关的,注释掉后者随便给一个字符串应该没关系

重新运行,果然成功了

在 vlc-android/vlc-android/build/outputs/apk/下会生成安装包

原文地址:https://www.cnblogs.com/lanqie/p/7442685.html