提交 4868d4e9 authored 作者: caoyongfeng's avatar caoyongfeng

android 依赖完善

上级 5e7406f0
buildscript { buildscript {
repositories { repositories {
google() google()
...@@ -14,19 +12,19 @@ buildscript { ...@@ -14,19 +12,19 @@ buildscript {
// 应用本地依赖配置 // 应用本地依赖配置
apply from: 'local-dependencies.gradle' apply from: 'local-dependencies.gradle'
// 配置Gradle解决AAR-in-AAR问题 // 配置Gradle解决AAR-in-AAR问题
allprojects { //allprojects {
configurations.all { // configurations.all {
// 允许本地AAR作为库文件 // // 允许本地AAR作为库文件
resolutionStrategy.dependencySubstitution.all { DependencySubstitution dependency -> // resolutionStrategy.dependencySubstitution.all { DependencySubstitution dependency ->
if (dependency.requested instanceof ModuleComponentSelector) { // if (dependency.requested instanceof ModuleComponentSelector) {
def module = dependency.requested as ModuleComponentSelector // def module = dependency.requested as ModuleComponentSelector
if (module.group == 'com.arthenica' && module.module == 'ffmpeg-kit-https') { // if (module.group == 'com.arthenica' && module.module == 'ffmpeg-kit-https') {
dependency.useTarget(files(rootProject.ext.ffmpegDependency).singleFile) // dependency.useTarget(files(rootProject.ext.ffmpegDependency).singleFile)
} // }
} // }
} // }
} // }
} //}
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
...@@ -63,12 +61,13 @@ repositories { ...@@ -63,12 +61,13 @@ repositories {
dependencies { dependencies {
implementation 'androidx.annotation:annotation:1.2.0' implementation 'androidx.annotation:annotation:1.2.0'
implementation project(':ffmpeg_aar')
// implementation 'com.arthenica:ffmpeg-kit-https:4.5.1-1' // implementation 'com.arthenica:ffmpeg-kit-https:4.5.1-1'
// implementation files('libs/ffmpeg-kit-https-5.1.aar') // implementation files('libs/ffmpeg-kit-https-5.1.aar')
// api(project(":cabinet_aar")) // api(project(":cabinet_aar"))
// api project(':android_aar') // api project(':android_aar')
} }
apply from: 'dependency-resolution.gradle' //apply from: 'dependency-resolution.gradle'
configurations.maybeCreate("default")
artifacts.add("default", file("ffmpeg-kit-https-5.1.aar"))
\ No newline at end of file
rootProject.name = 'ffmpeg-kit-flutter-android' rootProject.name = 'ffmpeg-kit-flutter-android'
// 覆盖插件对FFmpeg的依赖配置 //// 覆盖插件对FFmpeg的依赖配置
gradle.projectsEvaluated { //gradle.projectsEvaluated {
project(':ffmpeg_kit_flutter').afterEvaluate { // project(':ffmpeg_kit_flutter').afterEvaluate {
it.configurations.implementation.dependencies.removeAll { // it.configurations.implementation.dependencies.removeAll {
it.group == 'com.arthenica' && it.name == 'ffmpeg-kit-https' // it.group == 'com.arthenica' && it.name == 'ffmpeg-kit-https'
} // }
} // }
} //}
\ No newline at end of file
include ':ffmpeg_aar' // 添加新模块
project(':ffmpeg_aar').projectDir = new File('mylibrary')
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论