当前位置: 首页 > 知识库问答 >
问题:

没有找到与给定名称匹配的资源:attr android:actionmodesharedrawable,即使我使用的是appcompat 20

蓬弘
2023-03-14
buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/repo' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/repo' }
}


android {
    compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
    buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION


    defaultConfig {
        //noinspection GroovyAssignabilityCheck
        minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
        targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
        versionCode 15
        versionName "1.8"
    }


    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            signingConfig signingConfigs.release
        }

        debug {
            debuggable true
            applicationIdSuffix ".debug"
        }
    }
}

dependencies {
    compile 'com.android.support:support-v4:19.1.0'
    compile 'com.android.support:appcompat-v7:20.0.0'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.sothree.slidinguppanel:library:+'
    provided 'com.google.android.gms:play-services:5.0.89'
    compile project(':libraries:ViewPagerIndicator')
    compile files('libs/mobileservices-1.1.5.jar')
    compile files('libs/volley.jar')
    compile files('libs/picasso-2.3.5-SNAPSHOT.jar')
    compile 'com.microsoft.azure.android:azure-storage-android:0.3.1'
    compile 'com.squareup.okhttp:okhttp:2.1.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.1.0'
    compile('com.crashlytics.sdk.android:crashlytics:2.1.0@aar') {
        transitive = true;
    }
}
ANDROID_BUILD_MIN_SDK_VERSION=15
ANDROID_BUILD_TARGET_SDK_VERSION=19
ANDROID_BUILD_TOOLS_VERSION=20
ANDROID_BUILD_SDK_VERSION=19

我不是在引用Android5 SDK或兼容库v21,那么为什么它会困扰我这个资源键呢?

共有1个答案

松霖
2023-03-14

我不知道是什么原因造成的,但我也遇到了同样的问题,这个变通办法对我有效:

添加

configurations.all {
    resolutionStrategy {
        force 'com.android.support:appcompat-v7:20.0.0'
    }
}

在你的分级文件中的android{}块下面。

compile('com.sothree.slidinguppanel:library:+') {
    exclude group: 'com.android.support', module: 'appcompat-v7'
}
 类似资料: