【发布时间】:2020-09-30 01:15:01
【问题描述】:
过去几天我一直在熟悉 Android Studio,它大部分时间都很稳定,直到我添加了 Material Design 依赖项,并且在构建项目时遇到了一大堆错误。
我一直在修改 buildtools/sdk 版本,但似乎没有任何效果。
这是我的 build.gradle 文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "app.anuythe.com.apend"
minSdkVersion 24
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.1.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
}
【问题讨论】:
-
使用 compileSdkVersion 29 并且不要将 androidx 库与支持库混用
标签: android android-studio gradle material-design