【问题标题】:Didn't find class "android.support.v7.internal.widget.TintManager" on path: DexPathList在路径上找不到类“android.support.v7.internal.widget.TintManager”:DexPathList
【发布时间】:2015-12-02 15:28:55
【问题描述】:

我已将支持库更新到版本 23.0.1 并开始出现此错误。

在路径:DexPathList 上找不到类“android.support.v7.internal.widget.TintManager”。

我在应用程序中使用了许多第三方库。这会导致这个问题吗?

Gradle 文件:

   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:3.0.1@aar'
    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:0.2.2@aar') {
        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'
            }
}

【问题讨论】:

    标签: android android-appcompat


    【解决方案1】:

    升级到 Android Studio 2.0 后我遇到了同样的问题。我更新了不是最新的依赖项,现在它运行良好。

    通过交叉引用我们的 gradle 文件,我认为您需要更新您的设计支持库:

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

    【讨论】:

      【解决方案2】:

      我从以下位置降级了 appcompat-v7:

      编译'com.android.support:appcompat-v7:23.1.1'

      到:

      编译'com.android.support:appcompat-v7:23.1.0'

      它成功了。

      【讨论】:

        【解决方案3】:

        有人回答设置更高版本,而有人说更低版本。这是因为 gradle 静默使用更高版本,即使你定义为23.1.1。 (此时使用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;
        }
        

        【讨论】:

        • 我确保我在所有地方都使用了相同的支持库版本 (24.0.0),但它仍然无法正常工作,直到我替换了所有将 TintManager 与 AppCompatDrawableManager 一起使用的地方。似乎他们已经用 AppCompatDrawableManager 替换了 TintManager,因为 [这里][1] AppCompatDrawableManager 仍然有标签 TintManager。 [1]:github.com/android/platform_frameworks_support/blob/…
        【解决方案4】:

        有一些库和工具和库的组合不兼容,或者可能导致错误。一种这样的不兼容性是使用不是最新版本的 android-support 库版本(或者特别是低于目标 sdk 版本的版本)进行编译。

        【讨论】:

          【解决方案5】:

          Support V4 库是大部分 Android 支持库的基础,包含许多专注于使向后兼容更容易的类。

          尝试添加

          com.android.support:support-v4:23.1.0
          

          【讨论】:

          • 试过了,还是不行。还是报同样的错误。
          【解决方案6】:

          在 Viewpager 中使用 Tabs 时,会导致问题: 因此,要解决它,请尝试将您的 support:appcompat-v7:23.2.1 降级为 23.2.0 或在最后一位数减少一位。 我找到了解决方案,希望你也得到它。 :)

          【讨论】:

            猜你喜欢
            • 2017-10-06
            • 2016-02-04
            • 2017-09-12
            • 2014-05-29
            • 1970-01-01
            • 2015-07-01
            • 2018-12-30
            • 2015-01-02
            相关资源
            最近更新 更多