使用AndroidX時報錯Error: Program type already present

一、借鑑:https://www.jianshu.com/p/0cfd76a74c60

二、報錯提示

如果在使用AndroidX庫時, 又不小心間接使用了其他的老庫, 可能會遇到如下的報錯:

Error: Program type already present: android.support.v4.os.ResultReceiver$1

Error: Program type already present: android.support.v4.app.INotificationSideChannel

Error: Program type already present: xxxxxxxx(此處可能會有各種變形)

三、解決方案

可以嘗試在gradle.properties中添加:

android.useAndroidX=true
android.enableJetifier=true

 

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