build ijkplayer

概述

编译ijkplayer项目

配置

(1)安装git yasm

sudo apt-get install ysam

(2)安装android studio和android sdk

https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
sdk可以在Android studio中的sdk manager中安装

(3)下载ndk

https://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip

(4)设置环境变量

sudo vim /etc/profile

export ANDROID_SDK=/home/zzq/software/androidSdk
export ANDROID_NDK=/home/zzq/software/android-ndk-r10e
export PATH=$PATH:$ANDROID_SDK/tools:$ANDROID_NDK

(5)拉取ijkplayer代码

git clone https://github.com/Bilibili/ijkplayer ijkplayer-android
cd ijkplayer-android
git checkout -B latest k0.8.8

(6)初始化操作:下载FFmpeg库

./init-android.sh

(7)编译ffmpeg

cd android/contrib
./compile-ffmpeg.sh clean
./compile-ffmpeg.sh all

(8)编译ijkplayer

cd ..
./compile-ijk.sh all

(9)Android studio运行ijkplayer-example

打开ijkplayer-android/android/ijkplayer目录

问题

1. 找不到ANDROID_HOME或者sdk的路径

sudo vim /etc/profile

export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools

2. sdk版本需要25.0还有platform tools的版本

在Android studio的sdk manager那里下载就可以了

3. 报错Could not resolve com.android.support:appcompat-v7:23.0.1或者Please install the Android Support Repository from the Android SDK Manager.

build.gradle文件
allprojects {
    repositories {
        maven { url "https://maven.google.com" }
        jcenter()
    }
}
添加 maven { url "https://maven.google.com" }

补充

参考

1. android ijkplayer编译和导入ijkplayer-example例子
https://blog.csdn.net/baidu_19473529/article/details/99686585
2. How to set ANDROID_HOME path in ubuntu?
https://stackoverflow.com/questions/26256279/how-to-set-android-home-path-in-ubuntu
posted @ 2021-07-02 19:32  pyjetson  阅读(110)  评论(0编辑  收藏  举报