【发布时间】:2020-05-23 03:40:29
【问题描述】:
我在 android studio 中遇到问题。 我导入了这个项目并尝试使用 logcat 和木材日志,但它在构建中显示错误,而且在 logcat 中我看不到我的项目,没有显示可调试的过程。
这是 build.gradle 文件
buildscript {
ext.kotlin_version = '1.3.30'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这个 gradle 应用代码
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.android.dessertpusher"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha4'
implementation 'com.jakewharton.timber:timber:4.7.1'
}
这是错误,我的资源选项卡中没有 values.xml 资源
.gradle\caches\transforms-2\files-2.1\d8475bbb2e3cd4785bafd0a23122f74a\constraintlayout-2.0.0-alpha4\res\values\values.xml:209:5-3555: AAPT: error: resource attr/motionProgress (aka com.example.android.dessertpusher:attr/motionProgress) not found.
【问题讨论】:
标签: android android-studio kotlin gradle build.gradle