我嘗試添加支持片段,問題從那里開始。構建版本不支持支持庫。以前的構建版本是 28,支持庫版本是 27.1.1。這運作良好。我嘗試將版本更新到 28,然后支持庫到 28.0.0。但它給了我錯誤?,F在收到多個錯誤后,我遇到了明顯的合并錯誤。我嘗試按照 stackoverflow 上的建議將 androidx 用于支持庫。但是在項目的每個類中導入另一個庫是一個非常漫長和令人厭煩的過程。我不愿意那樣做。有沒有其他方法可以解決這個問題?應用程序:Gradle 文件 apply plugin: 'com.android.application'apply plugin: 'io.fabric'android { compileSdkVersion 28 buildToolsVersion '28.0.3' defaultConfig { applicationId "com.creditone.admin.OnBoarding" minSdkVersion 19 targetSdkVersion 28 versionCode 61 versionName "1.11" vectorDrawables.useSupportLibrary = true testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } repositories { maven { url 'https://maven.fabric.io/public' } } aaptOptions { additionalParameters "--no-version-vectors" } buildTypes { release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } lintOptions { quiet true abortOnError false ignoreWarnings true checkReleaseBuilds false } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }}allprojects { repositories { maven { url "https://jitpack.io" } }}dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.android.support.constraint:constraint-layout:1.1.3' androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) }}apply plugin: 'com.google.gms.google-services'
3 回答

慕標琳琳
TA貢獻1830條經驗 獲得超9個贊
嘗試以下選項
首選項->構建、執行、部署->即時運行->取消選中啟用即時運行
更新依賴版本以符合目標 SDK 版本。如果您發現任何版本不匹配,請先嘗試第二個選項,如果未解決則移至第一個選項。

撒科打諢
TA貢獻1934條經驗 獲得超2個贊
我已遷移到 28.0.0 和 comiple 版本 28 之后推薦用于支持庫的 androidx。
下面給出androidx的描述
https://developer.android.com/jetpack/androidx/
我檢查了這個視頻以避免手動更改導入庫的麻煩。
https://www.youtube.com/watch?v=0FZ_eUIsLTg
希望這對將面臨此問題的開發人員有所幫助。:-)
添加回答
舉報
0/150
提交
取消