在该应用程序运行正常之前,在集成某些库之后获取了一个奇怪的gradle构建错误,但现在显示以下错误。
Program type already present: com.nostra13.universalimageloader.cache.disc.impl.ext.DiskLruCache$1
Message{kind=ERROR, text=Program type already present: com.nostra13.universalimageloader.cache.disc.impl.ext.DiskLruCache$1, sources=[Unknown source file], tool name=Optional.of(D8)}
导入以下库时会出现此错误 -
compile("com.vdopia.ads.lw:coresdk:2.5.3.3")
compile("com.vdopia.ads.lw:google-adapter:1.0.7")
compile("com.vdopia.ads.lw:adcolony-adapter:1.0.5")
compile("com.vdopia.ads.lw:applovin-adapter:1.0.5")
compile("com.vdopia.ads.lw:baidu-adapter:1.0.5")
compile("com.vdopia.ads.lw:chartboost-adapter:1.0.7")
compile("com.vdopia.ads.lw:facebook-adapter:1.0.5")
compile('com.devbrackets.android:exomedia:4.0.3') //{
//If you use your own version of exoplayer, uncomment below
// exclude group: 'com.google.android.exoplayer'
// }
/*
* Note: If you use the Baidu adapter, then please include:
*/
compile ("com.android.support:palette-v7:27.1.1")
compile("com.vdopia.ads.lw:inmobi-adapter:1.0.5")
compile("com.vdopia.ads.lw:ironsrc-adapter:1.0.5")
compile("com.vdopia.ads.lw:loopme-adapter:1.0.5")
compile("com.vdopia.ads.lw:mopub-adapter:1.0.5")
compile("com.vdopia.ads.lw:tapjoy-adapter:1.0.5")
compile("com.vdopia.ads.lw:unity-adapter:1.0.7")
compile("com.vdopia.ads.lw:vungle-adapter:1.0.5")
compile("com.vdopia.ads.lw:yahoo-adapter:1.0.5")
compile("com.vdopia.ads.lw:youappi-adapter:1.0.1")
compile("com.vdopia.ads.lw:ogury-adapter:1.0.1")
答案 0 :(得分:2)
您的多个依赖项中有一个共享相同路径和名称的类。准确找出它们中的哪些依赖项,并使用exclude group
来省略它,例如。
compile("com.vdopia.ads.lw:coresdk:2.5.3.3") { exclude group: 'com.nostra13.universalimageloader' }