【Android开发】&More than one file was found with OS independent path 'META-INF/androidx

今天在拿到工程后,这份源代码一部分是由另外同事写的,而在我们的机子上运行却是出现如图的错误。最后查阅了相关的资料,原本想着在packagingOptions中添加去掉重复编译。结果添加了,又出现了新的错误。

 packagingOptions {
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/androidx.legacy_legacy-support-core-utils.version'
        exclude 'META-INF/androidx.loader_loader.version'
    }

最后查阅了相关资料,是android.support和android不能共存,而我们在dependencies就出现两个公用的情形,用的recyclerview

,那解决问题的办法自然就是删除掉android.support库即可。

    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章