如何去除Androidx引用

一匙赞、修改項目gradle.properties文件:

#true表示當(dāng)前項目啟用AndroidX
android.useAndroidX=false
#true表示將依賴包也遷移到AndroidX
android.enableJetifier=false

二佛掖、在build.gradle去掉androidx的引用,改為supportv7的引用

implementation 'com.android.support:appcompat-v7:28.0.0'

三涌庭、sync代碼之后如果還有androidx包引用沖突的問題芥被,可在build.gradle如下設(shè)置,完全去掉androidx的依賴:

android {
    configurations {
        all*.exclude group: 'androidx.arch.core'
        all*.exclude group: 'androidx.lifecycle'
        all*.exclude group: 'androidx.paging'
        all*.exclude group: 'androidx.room'
        all*.exclude group: 'androidx.sqlite'
        all*.exclude group: 'androidx.constraintlayout'
        all*.exclude group: 'androidx.vectordrawable'
        all*.exclude group: 'androidx.appcompat'
        all*.exclude group: 'androidx.asynclayoutinflater'
        all*.exclude group: 'androidx.cardview'
        all*.exclude group: 'androidx.car'
        all*.exclude group: 'androidx.collection'
        all*.exclude group: 'androidx.coordinatorlayout'
        all*.exclude group: 'androidx.cursoradapter'
        all*.exclude group: 'androidx.browser'
        all*.exclude group: 'androidx.customview'
        all*.exclude group: 'com.google.android.material'
        all*.exclude group: 'androidx.documentfile'
        all*.exclude group: 'androidx.drawerlayout'
        all*.exclude group: 'androidx.exifinterface'
        all*.exclude group: 'androidx.gridlayout'
        all*.exclude group: 'androidx.heifwriter'
        all*.exclude group: 'androidx.interpolator'
        all*.exclude group: 'androidx.leanback'
        all*.exclude group: 'androidx.loader'
        all*.exclude group: 'androidx.localbroadcastmanager'
        all*.exclude group: 'androidx.media2'
        all*.exclude group: 'androidx.mediarouter'
        all*.exclude group: 'androidx.multidex'
        all*.exclude group: 'androidx.palette'
        all*.exclude group: 'androidx.percentlayout'
        all*.exclude group: 'androidx.leanback'
        all*.exclude group: 'androidx.legacy'
        all*.exclude group: 'androidx.preference'
        all*.exclude group: 'androidx.print'
        all*.exclude group: 'androidx.recommendation'
        all*.exclude group: 'androidx.recyclerview'
        all*.exclude group: 'androidx.slice'
        all*.exclude group: 'androidx.slidingpanelayout'
        all*.exclude group: 'androidx.annotation'
        all*.exclude group: 'androidx.core'
        all*.exclude group: 'androidx.contentpager'
        all*.exclude group: 'androidx.legacy'
        all*.exclude group: 'androidx.dynamicanimation'
        all*.exclude group: 'androidx.emoji'
        all*.exclude group: 'androidx.fragment'
        all*.exclude group: 'androidx.media'
        all*.exclude group: 'androidx.tvprovider'
        all*.exclude group: 'androidx.vectordrawable'
        all*.exclude group: 'androidx.swiperefreshlayout'
        all*.exclude group: 'androidx.textclassifier'
        all*.exclude group: 'androidx.transition'
        all*.exclude group: 'androidx.versionedparcelable'
        all*.exclude group: 'androidx.viewpager'
        all*.exclude group: 'androidx.wear'
        all*.exclude group: 'androidx.webkit'
    }
}
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末坐榆,一起剝皮案震驚了整個濱河市拴魄,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌席镀,老刑警劉巖匹中,帶你破解...
    沈念sama閱讀 217,826評論 6 506
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異豪诲,居然都是意外死亡顶捷,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,968評論 3 395
  • 文/潘曉璐 我一進(jìn)店門屎篱,熙熙樓的掌柜王于貴愁眉苦臉地迎上來服赎,“玉大人,你說我怎么就攤上這事芳室∽ǚ荆” “怎么了?”我有些...
    開封第一講書人閱讀 164,234評論 0 354
  • 文/不壞的土叔 我叫張陵堪侯,是天一觀的道長嚎尤。 經(jīng)常有香客問我,道長伍宦,這世上最難降的妖魔是什么芽死? 我笑而不...
    開封第一講書人閱讀 58,562評論 1 293
  • 正文 為了忘掉前任,我火速辦了婚禮次洼,結(jié)果婚禮上关贵,老公的妹妹穿的比我還像新娘。我一直安慰自己卖毁,他們只是感情好揖曾,可當(dāng)我...
    茶點故事閱讀 67,611評論 6 392
  • 文/花漫 我一把揭開白布落萎。 她就那樣靜靜地躺著,像睡著了一般炭剪。 火紅的嫁衣襯著肌膚如雪练链。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,482評論 1 302
  • 那天奴拦,我揣著相機與錄音媒鼓,去河邊找鬼。 笑死错妖,一個胖子當(dāng)著我的面吹牛绿鸣,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播暂氯,決...
    沈念sama閱讀 40,271評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼潮模,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了株旷?” 一聲冷哼從身側(cè)響起再登,我...
    開封第一講書人閱讀 39,166評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎晾剖,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體梯嗽,經(jīng)...
    沈念sama閱讀 45,608評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡齿尽,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,814評論 3 336
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了灯节。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片循头。...
    茶點故事閱讀 39,926評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖炎疆,靈堂內(nèi)的尸體忽然破棺而出卡骂,到底是詐尸還是另有隱情,我是刑警寧澤形入,帶...
    沈念sama閱讀 35,644評論 5 346
  • 正文 年R本政府宣布全跨,位于F島的核電站,受9級特大地震影響亿遂,放射性物質(zhì)發(fā)生泄漏浓若。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,249評論 3 329
  • 文/蒙蒙 一蛇数、第九天 我趴在偏房一處隱蔽的房頂上張望挪钓。 院中可真熱鬧,春花似錦耳舅、人聲如沸碌上。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,866評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽馏予。三九已至天梧,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間吗蚌,已是汗流浹背腿倚。 一陣腳步聲響...
    開封第一講書人閱讀 32,991評論 1 269
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留蚯妇,地道東北人敷燎。 一個月前我還...
    沈念sama閱讀 48,063評論 3 370
  • 正文 我出身青樓,卻偏偏與公主長得像箩言,于是被迫代替她去往敵國和親硬贯。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,871評論 2 354

推薦閱讀更多精彩內(nèi)容