发现重复的类模块 classes.jar [英] Duplicate class found modules classes.jar

查看:77
本文介绍了发现重复的类模块 classes.jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实现此依赖项后出现此错误 implementation 'com.google.android.exoplayer:exoplayer:2.11.7' .我正在使用 VideoView 但现在我想使用 ExoPlayer 因为视频在 VideoView 中滞后所以我认为这会起作用.和完整的错误是这样的.

i am getting this error after implementing this dependency implementation 'com.google.android.exoplayer:exoplayer:2.11.7' . i was using VideoView but now i want to use ExoPlayer because video is lagging in VideoView so i thought this would work . and complete error is something like this .

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)

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

i try to find some solution but most of answer says to remove one of dependency . i can not remove one of them . i want both . so what i can do in this condition ?

编辑 1:

我做了这样的事情

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

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

and now i don't have those conflict errors but now i am getting some new error here it is :

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 岁以下的用户,我尝试在网上找到解决方案,但它给了我中文论坛,但我没有懂中文提前谢谢你.

i tried to update my minSdkVersion to 24 and they were gone becuase we have lots user below 24 , i try to find solution on the web but it gives me forum in Chinese and i don't understand Chinese Thank You in advance .

推荐答案

您需要从导入包中排除其中一个依赖项.

You would need to exclude one of the dependencies from importing the package.

所以要么改变

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'
}

这篇关于发现重复的类模块 classes.jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆