android-studio - 错误:多个库的包名称为“android.support.graphics.drawable”
问题描述
我正在尝试学习android studio。在这台电脑上(不是我的)android studio 版本是 2.2.3
当我在 gradle build 时创建一个新项目时发生错误。
错误:任务“:app:processDebugResources”执行失败。
错误:多个库的包名称为“android.support.graphics.drawable”
我一直在寻找这个错误一天。我在任何地方都没有找到相同的主题,所以我必须打开这个线程。感谢您从现在开始的所有答案。
这是 build.gradle(project:myapplication2)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这是 build.gradle(module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.0"
defaultConfig {
applicationId "com.example.alicetin.myapplication"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:28.+'
testCompile 'junit:junit:4.12'
}
解决方案
尝试
implementation 'com.android.support:appcompat-v7:27.1.1'
代替
compile 'com.android.support:appcompat-v7:28.+'
appcompat-v7 版本 28 仍然是alpha
推荐阅读
- sql - 如何从 SQL Server 表中的单个日期列获取开始/结束日期
- javascript - 在 Express.js 中,为什么我下载的文件大小与服务器文件大小不同?
- python - 如何访问类方法中的变量(属性)?
- javascript - 将字符串格式日期与 dd/mm 格式日期进行转换和比较?
- python - 如何使用 spaCy 查找 2 个依赖树之间的相似性?
- python - 在 Scale 中在 python 中创建 CosmosDB 图
- networking - 我们可以有两个具有不同 CLASS 类型的相同 IP 地址吗
- clean-architecture - 清洁架构:内存实体的哪一层?
- android - onBindViewHolder 在片段中打开对话框时总是触发
- docker - docker 容器:服务立即退出