错误:“:"不是有效的资源名称字符 [英] Error: ':' is not a valid resource name character
本文介绍了错误:“:"不是有效的资源名称字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经将我的 eclipse 项目导入到 android studio.我用谷歌搜索但没有得到正确的答案.出现这些错误-
I have imported my eclipse project to android studio.I googled but not getting right answer. These errors are occurred-
D:\***\app\src\main\res\values\strings.xml
Error:Error: ':' is not a valid resource name character
:app:mergeDebugResources FAILED
Error:Execution failed for task ':app:mergeDebugResources'.
> D:\****\app\src\main\res\values\strings.xml: Error: ':' is not a valid resource name character
我的 bulid gradle 应用代码是
My bulid gradle app code is
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.******.***"
minSdkVersion 21
targetSdkVersion 22
multiDexEnabled true }
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories { mavenCentral() }
dependencies {
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.google.android.gms:play-services:+'
compile files('libs/httpmime-4.1.1.jar')
compile files('libs/ormlite-android-4.43.jar')
compile files('libs/ormlite-core-4.43.jar')
}
请解决我的问题.谢谢
推荐答案
错误:':' 不是有效的资源名称字符
Error: ':' is not a valid resource name character
意味着你有一个像
<string name="not:valid">Foobar</string>
但不允许使用冒号.
试试这个:
打开你的
string.xml
输入 Ctrl + F(在 Win/Linux 上)
Type Ctrl + F (on Win/Linux)
检查Regex并按"[A-Za-z_]*:[A-Za-z_]*"
去掉冒号,必要时用下划线替换_
Remove colon and if necessary replace with an underscore _
编译你的apk
这篇关于错误:“:"不是有效的资源名称字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文