繁体   English   中英

如何修复包名称 'android.support.graphics.drawable' 用于:com.android.support:animated-vector-drawable:28.0.0

[英]How Fix Package name 'android.support.graphics.drawable' used in: com.android.support:animated-vector-drawable:28.0.0

AndroidManifest.xml 错误:包名称“android.support.graphics.drawable”用于:com.android.support:animated-vector-drawable:28.0.0, com.android.support:support-vector-drawable:28.0.0

https://imgur.com/6aFUN59

https://imgur.com/C1EmnJ3

升级 Android Studio 3.4 后发生错误已尝试将 compileSdk 更改为27 / 27.1.1但仍然相同,并且已经尝试禁用“vector-drawable”lib 但仍然相同。 . . . . . . .

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        maven { url 'https://maven.fabric.io/public'}
        maven { url 'https://maven.google.com' }
    }
    dependencies {
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'io.fabric.tools:gradle:1.26.1'
        classpath 'com.google.firebase:firebase-plugins:1.2.0'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.firebase.firebase-perf'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "xxx.packacge.name"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 4
        versionName "Dev"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }

    applicationVariants.all { variant ->
        //variant.getAssembleProvider()
        variant.outputs.all {
            outputFileName = "${variant.name}-${variant.versionName}.apk"
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            debuggable false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
        }
    }
    buildToolsVersion = '28.0.3'
}

repositories {
    mavenCentral()
    jcenter()
    maven { url 'https://maven.google.com' }

}

dependencies {

    configurations.all {
        exclude group: 'com.android.support', module: 'support-v13'
    }
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:support-vector-drawable:28.0.0'
    implementation 'com.android.support:animated-vector-drawable:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha5'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support:support-fragment:28.0.0'

}
apply plugin: 'com.google.gms.google-services'

..

buildscript {

    repositories {
        google()
        jcenter()
        mavenCentral()
        maven {
            url 'https://maven.fabric.io/public'
        }
        maven {
            url 'https://maven.google.com/'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.0'
        classpath 'com.google.gms:google-services:4.2.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.firebase:firebase-plugins:1.2.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
        mavenCentral()
        maven {
            url 'https://maven.google.com/'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

..

你应该试试这种方式

    implementation('com.android.support:support-vector-drawable:28.0.0') {
            exclude group: 'android.support.graphics.drawable'
            exclude module: 'support-vector-drawable'
        }
implementation('com.android.support:support-vector-drawable:28.0.0') {
        exclude group: 'android.support.graphics.drawable'
        exclude module: 'support-vector-drawable'
    }

试试这个

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM