首页 > 解决方案 > Exoplayer - 以下类的超类型无法解析

问题描述

我知道,有很多类似标题的问题。我已经经历了所有这些,尝试了所有提出的解决方案,但没有任何帮助。

我有一个带有一些Exoplayer依赖项的 Android 库。我的图书馆已经出版JCenter了几年,一切正常。现在JCenter正在关闭,我迁移到MavenCentral/Sonatype.

我添加了gradle-maven-publish-plugin以将我的库上传并发布到Sonatype. Android Gradle Plugin除了升级from3.5.14.0.0当然应用新添加的依赖项之外,我没有对我的代码进行任何更改gradle-maven-publish-plugin

结构如下。我的库包含一个类:

open class BasePlayer: Player.EventListener, AdEvent.AdEventListener, AdErrorEvent.AdErrorListener

在我的应用程序中,我扩展了这个类:

class MyPlayer: BasePlayer

现在,当我将新工件从添加MavenCentral/Sonatype到我的项目时,项目构建并且我的库文件可以访问,但Exoplayer依赖项不能访问。我收到以下错误:

Cannot access 'com.google.android.exoplayer2.Player$EventListener' which is a supertype of 'com.test.playground.myapplication.MyPlayer'. Check your module classpath for missing or conflicting dependencies
Cannot access 'com.google.ads.interactivemedia.v3.api.AdEvent$AdEventListener' which is a supertype of 'com.test.playground.myapplication.MyPlayer'. Check your module classpath for missing or conflicting dependencies
Cannot access 'com.google.ads.interactivemedia.v3.api.AdErrorEvent$AdErrorListener' which is a supertype of 'com.test.playground.myapplication.MyPlayer'. Check your module classpath for missing or conflicting dependencies

是的,Exoplayer我的库中的依赖项是使用api而不是添加的implementation——正如我提到的,这个库已经存在JCenter了几年。

有什么想法吗?我已经为此苦苦挣扎了几天。如果您需要更多信息,请发表评论 - 我会在这里,像疯子一样刷新此页面 :)

标签: androidmavengradleexoplayerexoplayer2.x

解决方案


推荐阅读