【发布时间】:2018-11-18 19:43:12
【问题描述】:
我在编辑我的 gradle 文件后尝试同步时不断收到此错误:
Android 资源编译失败输出: C:\Users\user\Desktop\Git\app_name\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:797: 错误:内部元素必须是资源引用或 空。
下面是我编辑的gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "app_id"
minSdkVersion 15
targetSdkVersion 27
versionCode 2
versionName "0.1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.facebook.stetho:stetho-js-rhino:1.3.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "android.arch.persistence.room:runtime:1.1.1"
implementation 'com.google.firebase:firebase-database:16.0.5'
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}
apply plugin: 'com.google.gms.google-services'
我已尝试清理、失效和重新启动以及删除构建文件夹
【问题讨论】:
-
看起来您在
values.xml的某处有一个<item></item>元素,其标签之间的值无效。
标签: android android-gradle-plugin