Android studio 禁用AndroidX方式
gradle.properties文件中添加
android.useAndroidX=false #禁用AndroidXandroid.enableJetifier=false #禁止第三方jar包使用androidX
補充知識:解決Android Studio androidx 包沖突問題
如果包沖突了會包如下這樣的錯:
Android dependency ’androidx.core:core’ has different version for the compile (1.0.0) and runtime (1.0.1) classpath. You should manually set the same version via DependencyResolution
1.打開Terminal
輸入:
./gradlew -q app:dependencies
查看依賴沖突文件
2.在build.gradle里buildscript標簽下添加
subprojects { project.configurations.all { resolutionStrategy.eachDependency { details -> if (details.requested.group == ’com.android.support’ && !details.requested.name.contains(’multidex’) ) { details.useVersion '27.1.1' } if (details.requested.group == ’androidx.core’ && !details.requested.name.contains(’androidx’) ) { } } } }
某個包沖突 就 在group androidx.core 并且指定Androidx 要用的版本
以上這篇Android studio 禁用AndroidX方式就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持好吧啦網(wǎng)。
相關文章:
1. CSS自定義滾動條樣式案例詳解2. 通過工廠模式返回Spring Bean方法解析3. JSP實現(xiàn)客戶信息管理系統(tǒng)4. PHP 面向對象程序設計之類屬性與類常量實現(xiàn)方法分析5. Java Spring WEB應用實例化如何實現(xiàn)6. python 批量下載bilibili視頻的gui程序7. Intellij IDEA連接Navicat數(shù)據(jù)庫的方法8. 關于Mysql-connector-java驅動版本問題總結9. 使用css實現(xiàn)全兼容tooltip提示框10. python numpy庫np.percentile用法說明
