android 配置報錯:Program type already present: android.support.v4.app.BackStackRecord$Op
阿新 • • 發佈:2019-01-30
最近在整理公司的一些專案,總結做過的專案檔案,每次從svn下載下來的專案 都會報錯,其他小問題 就不一一說了,見招拆招,碰到兩個頭疼的問題,最後發現 解決辦法是一樣 在這裡,跟大家分享一下,如果,你知道,可以忽略,
錯誤:Program type already present: android.support.v4.app.BackStackRecord$Op
錯誤:Program type already present: android.support.v4.app.ActionBarDrawerToggle$Delegate
兩個錯誤的大致意思就是 前邊已經存在了v4包的類檔案,說實話,沒太理解它真正的意義,不過已經猜出大概錯誤,是跟v4包有關。。
看了一些博友的部落格,發現我在配置
dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') testImplementation 'junit:junit:4.12' implementation 'com.google.code.gson:gson:2.3.1' implementation project(':library-pulltorefresh') implementation 'com.mcxiaoke.volley:library:1.0.16' implementation project(':library-sidedrawer') implementation project(':library-circleimageview') implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support:support-v4:27.1.1' implementation project(':library-slidingmenu') implementation 'com.baoyz.swipemenulistview:library:1.3.0' implementation 'org.greenrobot:eventbus:3.0.0'}
的時候 少了一個v4的匯入(不加這個匯入的話 ) 下面這行會報紅線,但是不影響程式執行
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
加上這句話之後,以上問題 迎刃而解。
說了這麼多,,就是少了這一行。。 作為一名努力的小猿,希望大家一起交流經驗,共同進步哦