Google材料设计库错误程序类型已存在:android.support.v4.app.INotificationSideChannel $ Stub $ Proxy [英] Google material design library error Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy

查看:10025
本文介绍了Google材料设计库错误程序类型已存在:android.support.v4.app.INotificationSideChannel $ Stub $ Proxy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我添加实现'com.google.android.material:material:1.0.0-alpha1'当我尝试构建我的项目时Android Studio说:

Whenever i add implemntation 'com.google.android.material:material:1.0.0-alpha1' when i try to build my project Android Studio says:


程序类型已存在:android.support.v4.app.INotificationSideChannel $ Stub $ Proxy
消息{kind = ERROR,text =程序类型已存在:android.support.v4.app.INotificationSideChannel $ Stub $ Proxy,sources = [未知源文件],工具名称= Optional.of(D8)}

Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy Message{kind=ERROR, text=Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy, sources=[Unknown source file], tool name=Optional.of(D8)}

这是我的gradle脚本:

This is my gradle script:

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 'android-P'
    defaultConfig {
        applicationId "it.smart.bab3"
        minSdkVersion 21
        targetSdkVersion 'p'
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
    implementation 'com.google.android.material:material:1.0.0-alpha1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:design:28.0.0-alpha1'
    implementation 'com.android.support:support-v4:28.0.0-alpha1'
}

我是新的ith这种类型的错误,我没有发现与这个错误。谢谢

I'm new ith this type of errors, and i didn't find anithing with this error. Thanks

推荐答案

我也一直在努力解决这个问题。最后,我成功地编译并运行了该项目。

I've been struggling all day with this issue too. Finally I managed to compile and run the project successfully.

首先,摆脱这个:

implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support:design:28.0.0-alpha1'
implementation 'com.android.support:support-v4:28.0.0-alpha1'

添加在你的gradle.properties文件中跟随:

Add the following in your gradle.properties file:

android.useAndroidX = true
android.enableJetifier = false

最后,同步项目然后编译。

And finally, sync the project and then compile.

如果它不起作用,请清理项目然后重建。

If it doesn't work, clean the project and then rebuild.

PS:我无法使targetSdkVersion'p'工作。我的build.gradle文件最终如下:

PS: I can't get targetSdkVersion 'p' to work. My build.gradle file end up as follows:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'android-P'
    defaultConfig {
        applicationId "com.github.alvarosct02.demo"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.google.android.material:material:1.0.0-alpha1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

}

希望它也适合你。

这篇关于Google材料设计库错误程序类型已存在:android.support.v4.app.INotificationSideChannel $ Stub $ Proxy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆