android - 调试到设备时Android资源编译失败
问题描述
当我将代码调试到设备时,我遇到了一些问题。错误显示如下:
Android resource compilation failed
/Users/agungnugroho/Downloads/AndroidStudioProjects/Version 3.0/hris/
app/build/intermediates/incremental/mergeDebugResources/merged.dir/
values/values.xml:4: error: unknown tag <:string>.
/Users/agungnugroho/Downloads/AndroidStudioProjects/Version 3.0/
hris/app/build/intermediates/incremental/mergeDebugResources/
merged.dir/values/values.xml:5: error: unknown tag <:string>.
/Users/agungnugroho/Downloads/AndroidStudioProjects/Version 3.0/
hris/app/build/intermediates/incremental/mergeDebugResources/
merged.dir/values/values.xml: error: file failed to compile.
当我添加库并在这里我的build.gradle代码时会发生这种情况:
android {
compileSdkVersion 26
defaultConfig {
applicationId "id.co.poslogistics.hris"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "0.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation "com.android.support:support-compat:26.0.0"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.squareup.picasso:picasso:2.4.0'
implementation 'com.github.bumptech.glide:volley-integration:1.4.0'
implementation 'io.jsonwebtoken:jjwt:0.6.0'
implementation 'com.koushikdutta.ion:ion:2.1.7'
implementation 'com.google.android:flexbox:0.2.5'
implementation 'com.github.bumptech.glide:glide:3.5.2'
implementation 'com.jakewharton:butterknife:8.5.1'
implementation 'com.android.support:design:26.0.0'
implementation 'com.github.gcacace:signature-pad:1.2.1'
implementation 'org.apache.httpcomponents:httpcore:4.4.9'
implementation 'com.google.android.gms:play-services-location:9.6.1'
implementation 'com.google.android.play:core:1.6.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
}
谁能帮助我,因为我不明白那个错误是什么?
解决方案
文件中的标签values.xml
应以 开头<string>
,而不是<:string>
.
推荐阅读
- r - 在R中找到具有2个变量的子集的平均值
- matlab - matlab中无法保存iverseftt图像和图像K-Space
- asp.net - NLog在asp.net中显示用户名的正确方法
- java - 为特定标签添加拦截到杰克逊
- python - 从转换输出张量恢复我的输入张量
- c++ - 在非 constexpr if 之后的“else if constexpr”是否合法?
- javascript - z index 1 不会阻止模态下推 index 0 内容
- c# - 如果一张桌子可以提供我们需要的信息,我需要加入另一张桌子吗
- python - 如何选择空白行之间的范围并使用 Openpyxl 复制到新工作表?
- interface - F90中加载模块和接口的正确结构是什么?