每当我添加 implemntation 'com.google.android.material:material:1.0.0-alpha1'
当我尝试构建我的项目时 Android Studio 说:
程序类型已经存在:android.support.v4.app.INotificationSideChannel\(Stub\)Proxy Message{kind=ERROR, text=程序类型已经存在:android.support.v4.app.INotificationSideChannel\(Stub\)Proxy, sources=[Unknown source file], 工具名=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'
}
我是这类错误的新手,我没有发现任何与此错误相关的信息。谢谢
原文由 Smart 发布,翻译遵循 CC BY-SA 4.0 许可协议
我也整天都在为这个问题而苦苦挣扎。最后我成功地编译并运行了这个项目。
首先,摆脱这个:
在 gradle.properties 文件中添加以下内容:
最后,同步项目然后编译。
如果它不起作用,请清理项目,然后重建。
PS:我无法让 targetSdkVersion ‘p’ 工作。我的 build.gradle 文件最终如下所示:
希望它也对你有用。