【发布时间】:2020-03-09 19:00:41
【问题描述】:
我正在处理这个项目:https://github.com/muxinc/mux-stats-sdk-exoplayer/tree/min_sdk_version_fix 这是一个名为 demo 的 Android 应用程序,它依赖于来自同一个名为 MuxExoPlayer 的项目的模块,该项目依赖于 MuxCore.jar 库。
当我尝试使用 minSdkVersion 16 编译项目时,我在 jar 文件上遇到了脱糖问题,错误:
Transform artifact full.jar (project :MuxExoPlayer) with DexingWithClasspathTransform
AGPBI: {"kind":"error","text":"Default method desugaring of `com.mux.stats.sdk.muxstats.MuxStatsExoPlayer` failed because it's hierarchy is incomplete. The class `com.mux.stats.sdk.core.events.EventBus` is missing and it is the declared super class of `com.mux.stats.sdk.muxstats.MuxBaseExoPlayer`","sources":[{}],"tool":"D8"}
当我使用 minSdkVersion 24 编译时,我没有收到此错误并且项目编译正常。
MuxCore.jar 也是用 gradle 构建的,这里是 gradle.build:
apply plugin: 'java-library'
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
tasks.withType(JavaCompile) {
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:23.0'
implementation 'org.json:json:20180130'
// Use JUnit test framework
testImplementation 'junit:junit:4.4'
testImplementation 'org.mockito:mockito-core:2.23.4'
}
我在这里缺少什么? 我需要如何编译 MuxCore 才能使用 android minSdkVersion 16 进行编译?
【问题讨论】:
标签: android android-studio gradle jar dependencies