gpt4 book ai didi

android - Gradle 脱糖失败,层次结构不完整

转载 作者:行者123 更新时间:2023-12-03 05:31:58 26 4
gpt4 key购买 nike

我正在做这个项目: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 进行编译?

最佳答案

我有同样的问题,也在 Mux github repo 中创建了一张票,但无法让它工作......如果你将 minSdk 更新为 24 它将工作......

https://github.com/muxinc/mux-stats-sdk-exoplayer/issues/19

对我有用的是:不要将 MuxStatsExoPlayer 作为模块添加,而是将应用程序模块中的所有文件和类直接添加到项目中,它应该可以工作。

关于android - Gradle 脱糖失败,层次结构不完整,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58846281/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com