gpt4 book ai didi

java - Google Material 设计库错误程序类型已存在:android.support.v4.app.INotificationSideChannel $ Stub $ Proxy

转载 作者:行者123 更新时间:2023-12-03 05:32:04 25 4
gpt4 key购买 nike

每当我尝试构建项目时添加implemntation 'com.google.android.material:material:1.0.0-alpha1'时,Android Studio都会说:

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脚本:
    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'
}

我是这种类型的错误的新手,但我没有发现与此错误有关的任何一种。谢谢

最佳答案

我也整天都在努力解决这个问题。最终,我成功地编译并运行了该项目。

首先,摆脱这一点:

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文件中添加以下内容:
android.useAndroidX = true
android.enableJetifier = false

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

如果不起作用,请清理项目,然后重新生成。

PS:我无法使targetSdkVersion'p'正常工作。我的build.gradle文件最终如下:
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'

}

希望它也对您有用。

关于java - Google Material 设计库错误程序类型已存在:android.support.v4.app.INotificationSideChannel $ Stub $ Proxy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58815887/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com