背景
项目中有引用 AndroidAudioConverter,引入方式:
implementation 'com.github.adrielcafe:AndroidAudioConverter:0.0.8'
gradle同步及编译代码都会报错:
Failed to resolve: com.github.adrielcafe:ffmpeg-android-java:2a627f6ecd
原因分析
AndroidAudioConverter 中有依赖:
ffmpeg-android-java
从其pom文件中可看出:
下载地址:https://maven.scijava.org/content/repositories/public/com/github/adrielcafe/AndroidAudioConverter/0.0.7/AndroidAudioConverter-0.0.7.pom
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<script/>
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.adrielcafe</groupId>
<artifactId>AndroidAudioConverter</artifactId>
<version>0.0.7</version>
<packaging>aar</packaging>
<name>adrielcafe/AndroidAudioConverter</name>
<description>Convert audio files inside your Android app easily. Supported formats: WAV, AAC, MP3, M4A, WMA and FLAC.</description>
<url>https://github.com/adrielcafe/AndroidAudioConverter</url>
<inceptionYear>2016</inceptionYear>
<developers>
<developer>
<id>adrielcafe</id>
<name>Adriel Café</name>
<email>me@adriel.cafe</email>
</developer>
</developers>
<scm>
<connection>scm:git://github.com/adrielcafe/AndroidAudioConverter.git</connection>
<developerConnection>scm:git://github.com/adrielcafe/AndroidAudioConverter.git</developerConnection>
<url>git://github.com/adrielcafe/AndroidAudioConverter.git</url>
</scm>
<dependencies>
<dependency>
<groupId>com.github.adrielcafe</groupId>
<artifactId>ffmpeg-android-java</artifactId>
<version>2a627f6ecd</version>
<type>aar</type>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
从报错能看出是没有找到这个包,我们进入maven仓看它到底在不在,
已经没了,不知道为什么,,,
解决方案
1.下载library导入到项目
下载地址:GitHub - WritingMinds/ffmpeg-android-java: Android java library for FFmpeg binary compiled using https://github.com/writingminds/ffmpeg-android
2.下载aar导入到项目
下载地址:https://download.csdn.net/download/wangsheng5454/87707455
导入后编译还是会报错,需要exclude掉
AndroidAudioConverter中的ffmpeg-android-java,如下:
implementation ('com.github.adrielcafe:AndroidAudioConverter:0.0.8'){
exclude group:'com.github.adrielcafe', module:'ffmpeg-android-java'
}