1. 程式人生 > >Android Studio更新導致Program type already present: android.support.design.widget.CoordinatorLayout$1

Android Studio更新導致Program type already present: android.support.design.widget.CoordinatorLayout$1

Android Studio 升級到3.1後,打包時會出現該錯誤。出現該錯誤的原因是各種support包相互衝突(design包版本衝突)。
網上少了一些方法,不過好像沒啥用(可能大家引入的庫不同,衝突不同吧),最後還是使用野路子解決的,在此記下一面日後再現。

網上方法

在我這沒起到作用


  • 方法一
build.gradle中的所有support依賴改為27.1.1
implementation 'com.android.support:appcompat-v7:27.1.1'

  • 方法二
如果以上方法不行,在dependencies{}
完成後做相關配置
configurations {
   all*.exclude group: 'com.android.support', module: 'support-v13'
}

以上方法我都試過,沒啥用,於是乎~~野路子來了

野路子

既然是design包版本衝突,那就將其統一!應該可以的!


  • 第一步
將所有support包中的design模組移除
implementation('com.android.support:appcompat-v7:27.1.0', {
    exclude group: 'com.android.support'
, module: 'design' }) implementation('com.android.support:recyclerview-v7:27.1.0', { exclude group: 'com.android.support', module: 'design' }) implementation('com.android.support:cardview-v7:27.1.0', { exclude group: 'com.android.support', module: 'design' }) implementation('com.android.support:customtabs:27.1.0'
, { exclude group: 'com.android.support', module: 'design' })

  • 第二步
統一design包的版本,與以上support包版本一致
implementation 'com.android.support:design:27.1.0'

  • 最後
SyncCleanBuild apk

打包成功啦!

目前專案裡就是這麼解決的!

相關推薦

Android Studio更新導致Program type already present: android.support.design.widget.CoordinatorLayout$1

Android Studio 升級到3.1後,打包時會出現該錯誤。出現該錯誤的原因是各種support包相互衝突(design包版本衝突)。 網上少了一些方法,不過好像沒啥用(可能大家引入的

Android Studio更新導致Program type already present:的問題以及如下描述。R檔案丟失問題 Error:Execution failed for task ':app:processDebugManifest'

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.1.1,

Android Studio更新導致Program type already present:的問題以及如下描述。R檔案丟失問題

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versi

Error: Program type already present: android.support.v4.app.FragmentTransitionCompat21$1

參考連結 https://stackoverflow.com/questions/52845161/error-program-type-already-present-android-support-v4-app-fragmenttransitionco 主要原因: gra

Error: Program type already present: android.support.v4.accessibilityservice.AccessibilityServiceInf

報錯原因:v4包衝突 配置ButterKnife過程中報錯(與support-v4包衝突,Program type already present: android.support.v4..) 解決 上github上原始碼那裡查了一下,在根目錄的build.gradle可以看到

解決Error: Program type already present: android.support.design.widget.CoordinatorLayout$Behavior

我專案中的build.gradle中本來是如下依賴 implementation 'com.android.support:appcompat-v7:27.1.1' 但是一旦編譯或執行就會出現這個錯誤 Error: Program type already present: androi

Compilation failed to complete:Program type already present: android.support.v4.accessibilityservice

.Compilation failed to complete .Program type already present:android.support.v4.accessibilityservice.AccessibilityServiceInfoCompatM

報錯Error : Program type already present: android.support.design.widget.CoordinatorLayout$

方法一 support依賴版本改為27.1.1並新增一下配置 implementation 'com.android.support:appcompat-v7:27.1.1' configur

android 配置報錯:Program type already present: android.support.v4.app.BackStackRecord$Op

最近在整理公司的一些專案,總結做過的專案檔案,每次從svn下載下來的專案 都會報錯,其他小問題 就不一一說了,見招拆招,碰到兩個頭疼的問題,最後發現 解決辦法是一樣 在這裡,跟大家分享一下,如果,你知道,可以忽略,錯誤:Program type already present

配置ButterKnife過程中報錯(與support-v4包衝突,Program type already present: android.support.v4..)解決

今天沒什麼任務,就想試著用一下butter knife,。雖然很早就聽說過,但是一直沒用過,所以打算試著用一下,看看利弊。我遇到的報錯是這樣的:我配置的support-v4跟butterknife中support-v4版本不一致,因為如果我把butterknife注掉的話就不

Program type already present: android.support.v4.app.backstackrecord$Op

除錯過程中如果出現上述錯誤 最好的解決辦法是把build.gradle檔案中的下面部分:dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.android.sup

Program type already present: android.support.v13.view.DragAndDropPermissionsCompat

今天在繼承GreenDao時遇到這個問題,這個問題不常見,記錄下來希望能夠幫到大家,解決方式:在gradle中的dependencies 中新增configurations { all*.exclude group: 'com.android.support', mo

Android Studio 編譯: Program type already present: XXX 解決方案

情況1:個例 build.gradle 中 dependencies { classpath 'com.android.tools.build:gradle:3.1.1' // } 改成 dependenc

Android. 依賴衝突 Program type already present

目錄 常用引用: 解決方案: 在實際開發中,為了提高開發速度和效率,避免不了引用第三方提供的依賴和類庫,如果含有相同依賴的類庫被我們引用時,而他們的版本又不相同,就有可能會導致一系列問題和異常:   常用引用: 網路相關:okhttp、retrofit、http

android Error: Program type already present: com.alibaba.android.arouter.routes.ARouter$$Group$$blog

這個問題的原因在與不同的module中的RouterPah的 一級名字相同造成的,或者專案中出現了相同的路徑。 比如專案結構是app ,moudleA,moduleB, 那麼moudleA 如果出現的路徑名是:"/module/test/testvideo",moduleB中出現了路徑名:"

Android解決依賴衝突:Program type already present

今天在編譯專案時,報錯: Program type already present: android.content.pm.IPackageDeleteObserver 就是依賴衝突,後來解決就是 雙擊shift,全域性查詢衝突的這個IPackageDeleteObserve ,發現

Program type already present:okio.AsyncTimeout$Watchdog Message{kind=ERROR, text=Program type :okio

有兩個okio 通過雙擊shift鍵盤,然後在輸入框裡面輸入AsyncTimeout,發現是因為有兩個okio.jar包,手動暴力刪除後就好了 然而過了幾天問題又重新出現了,一樣的問題,沒錯!就是下圖的這個問題 經過不懈的谷歌,終於找到了解決方案(在app下的build檔案下的andr

Program type already present: com.baidu.lbsapi.auth.ErrorMessage

百度地圖開發的時候遇到的問題,因為百度地圖不知道從什麼時候開始下載過來的SDK是包含了他們demo中用到的一些框架,所以哪個框架是有用的哪個是沒用的傻傻分不清,比如一般常用的jar包是BaiduLBS_Android.jar,這個jar包包含了百度地圖大部分功能開發所需,我在

Program type already present: com.google.gson.FieldAttributes

錯誤如下圖 問題原因:工程重複引用了gson的jar包所致。 解決辦法:在build.gradle的dependencies中加入程式碼:作用就是去除重複gson包 dependencies

android studio 更新 Gradle錯誤解決方法(Gradle sync failed)

app 是我 clear 聯網 建議 span 內容 roi file android studio 更新 Gradle錯誤解決方法 Android Studio每次更新版本都會更新Gradle這個插件,但由於長城的問題每次更新都是失敗,又是停止在Refre