找到重复的类模块classes.jar

时间:2020-08-06 11:57:07

标签: java android kotlin url android-videoview

实现此依赖项implementation 'com.google.android.exoplayer:exoplayer:2.11.7'后,我收到此错误。我当时使用的是VideoView,但现在我想使用ExoPlayer,因为视频滞后于VideoView,所以我认为这可以工作。完全错误就是这样。

Duplicate class android.support.v4.app.INotificationSideChannel found in modules classes.jar (androidx.core:core:1.0.1) and classes.jar (com.android.support:support-compat:27.0.2)

我尝试找到一些解决方案,但是大多数答案都说要删除一个依赖项。我无法删除其中一个。我都想要。那我在这种情况下能做什么?

编辑1:

我做了这样的事

implementation('com.google.android.exoplayer:exoplayer:2.11.7'){
        exclude group: 'androidx.core' , module : 'core'
        exclude group: 'androidx.media' , module : 'media'
    }

现在我没有那些冲突错误,但是现在我遇到了一些新错误:

AGPBI: {"kind":"error","text":"Invoke-customs are only supported starting with Android O (--min-api 26)","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"error","text":"Invoke-customs are only supported starting with Android O (--min-api 26)","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"error","text":"Invoke-customs are only supported starting with Android O (--min-api 26)","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"error","text":"Default interface methods are only supported starting with Android N (--min-api 24): java.lang.CharSequence com.google.android.exoplayer2.ui.PlayerNotificationManager$MediaDescriptionAdapter.getCurrentSubText(com.google.android.exoplayer2.Player)","sources":[{}],"tool":"D8"}
Invoke-customs are only supported starting with Android O (--min-api 26)

Default interface methods are only supported starting with Android N (--min-api 24): java.lang.CharSequence com.google.android.exoplayer2.ui.PlayerNotificationManager$MediaDescriptionAdapter.getCurrentSubText(com.google.android.exoplayer2.Player)

AGPBI: {"kind":"error","text":"Default interface methods are only supported starting with Android N (--min-api 24): void com.google.android.exoplayer2.Player$EventListener.onIsPlayingChanged(boolean)","sources":[{}],"tool":"D8"}
Default interface methods are only supported starting with Android N (--min-api 24): void com.google.android.exoplayer2.Player$EventListener.onIsPlayingChanged(boolean)

我试图将我的minSdkVersion更新为24,但由于我们有很多24岁以下的用户,所以他们消失了,我尝试在网络上找到解决方案,但这为我提供了中文论坛,但我听不懂中文 预先谢谢你。

1 个答案:

答案 0 :(得分:0)

您需要从导入软件包中排除一种依赖关系。

所以改变

implementation ('com.google.android.exoplayer:exoplayer:2.11.7')
{ 
exclude module : 'android.support.v4.app.INotificationSideChannel'
}

implementation ('androidx.core:core:1.0.1')
{ exclude module : 'android.support.v4.app.INotificationSideChannel'
}