2015-12-02 50 views
10

我已將支持庫更新到版本23.0.1,並開始出現此錯誤。未在路徑中找到類「android.support.v7.internal.widget.TintManager」:DexPathList

未在路徑DexPathList中找到類「android.support.v7.internal.widget.TintManager」。

我在應用程序中使用了許多第三方庫。是否會導致此問題?

搖籃文件:

apply plugin: 'com.android.application' 

repositories { 
    mavenCentral() 
    maven { url 'http://maven.stickerpipe.com/artifactory/stickerfactory' } 
} 

android { 
    compileSdkVersion 23 
    buildToolsVersion '23.0.1' 

    defaultConfig { 
     applicationId "xxxxxxxxx" 
     minSdkVersion 16 
     targetSdkVersion 22 
     versionCode 1 
     versionName "1.0" 
     multiDexEnabled true 
    } 
    buildTypes { 
     release { 
      minifyEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    packagingOptions { 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE-FIREBASE.txt' 
     exclude 'META-INF/NOTICE' 
    } 
    dexOptions { 
     incremental true 
     javaMaxHeapSize "4g" 
    } 
} 

dependencies { 
    apply plugin: 'com.google.gms.google-services' 
    compile 'com.google.android.gms:play-services:8.1.0' 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile 'de.hdodenhof:circleimageview:1.2.1' 
    compile 'com.android.support:recyclerview-v7:23.0.1' 
    compile 'com.android.support:appcompat-v7:23.0.1' 
    compile 'com.journeyapps:zxing-android-embedded:[email protected]' 
    compile 'com.google.zxing:core:3.2.0' 
    compile 'com.android.support:design:23.0.1' 
    compile 'com.squareup.picasso:picasso:2.4.0' 
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0' 
    compile('com.github.ganfra:material-spinner:1.1.0') { 
     exclude group: 'com.android.support', module: 'appcompat-v7' 
    } 
    compile 'com.cesarferreira.colorize:library:0.2.1' 
    compile 'com.instabug.library:instabugsupport:1+' 
    compile('vc908.stickers:stickerfactory:[email protected]') { 
     transitive = true; 
    } 
    compile 'com.android.support:multidex:1.0.0' 
    compile('com.mixpanel.android:mixpanel-android:4.6.4') 
      { 
       exclude group: 'com.android.support', module: 'appcompat-v7' 
      } 
} 

回答

0

支持V4庫充當的很多Android的支持庫的基礎,幷包含許多專注於製造的向後兼容性非常容易的類。

嘗試增加

com.android.support:support-v4:23.1.0 
+0

試過了,但沒有工作。仍然得到相同的錯誤。 –

20

我在升級至Android 2.0工作室後,同樣的問題。我更新了我的依賴關係,這些依賴關係不是最新的,現在運行良好。

通過交叉引用的gradle我們的文件,我認爲你需要更新你的設計支持庫:

compile 'com.android.support:design:23.1.1' 
11

我降級從程序兼容性-V7:

編譯「com.android.support :程序兼容性-V7:23.1.1'

到:

編譯 'com.android.support:appcompat-v7:23.1.0'

和它的工作。

+0

非常感謝你...... !!! –

4

有人回答設置較高版本,而有人說較低版本。這是因爲即使您定義爲23.1.1,gradle也會默認使用高版本。 (此時,它使用24.0.1來編譯)

我建議你檢查正確的版本是否涉及gradlew app:dependencies -q命令。

要修復其高版本切換,請將force = true設置爲以下所有支持庫。

compile ('com.android.support:support-v4:23.1.1'){ 
    force = true; 
} 
compile ('com.android.support:appcompat-v7:23.1.1'){ 
    force = true; 
} 
compile ('com.android.support:design:23.1.1'){ 
    force = true; 
} 
compile ('com.android.support:cardview-v7:23.1.1'){ 
    force = true; 
} 
compile ('com.android.support:recyclerview-v7:23.1.1'){ 
    force = true; 
} 
+0

這爲我工作。謝謝 –

+1

我確定我在任何地方都使用了相同的支持庫版本(24.0.0),並且在我替換TintManager與AppCompatDrawableManager一起使用的所有地方之前,它仍然無法正常工作。 似乎他們已經用AppCompatDrawableManager替換TintManager becase [here] [1] AppCompatDrawableManager仍然標記TintManager。 [1]:https://github.com/android/platform_frameworks_support/blob/62eb3105e51335cf9074a5506d8d2b220aeb95dc/v7/appcompat/src/android/support/v7/widget/AppCompatDrawableManager.java – shtolik

1

存在庫,工具和庫的某些組合,這些組合不兼容或可能導致錯誤。其中一種不兼容性是使用不是最新版本的Android支持庫(或特別是低於目標SDK版本的版本)進行編譯。

0

在Viewpager中使用Tab時,會導致問題: 因此通過降級你的支持:appcompat-v7:23.2.1到23.2.0或者最後一位數字減1。 我找到了解決方案,希望你也能得到它。 :)

相關問題