错误:“:"不是有效的资源名称字符 [英] 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
我的buldle 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')
}
请解决我的问题. 谢谢
Please resolve my issue. Thank you
推荐答案
错误::"不是有效的资源名称字符
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屋!
查看全文