Android 渐变生成错误:SAXParseException
在构建应用程序时,我遇到以下错误:Android 渐变生成错误:SAXParseException,android,android-gradle-plugin,saxparser,android-build,Android,Android Gradle Plugin,Saxparser,Android Build,在构建应用程序时,我遇到以下错误: Error:org.xml.sax.SAXParseException; lineNumber: 0; columnNumber: 0; cvc-pattern-valid: Value 'build-tools;23.0.0 rc3' is not facet-valid with respect to pattern '[a-zA-Z0-9_\-;.]+' for type 'segmentListType'. 模块级渐变的build.gradle:
Error:org.xml.sax.SAXParseException; lineNumber: 0; columnNumber: 0;
cvc-pattern-valid: Value 'build-tools;23.0.0 rc3'
is not facet-valid with respect to pattern '[a-zA-Z0-9_\-;.]+' for type 'segmentListType'.
模块级渐变的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "ms.demo.map"
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services-maps:8.4.0'
}
即使在清理应用程序后,错误仍然存在。包的结构与gradle文件中描述的
applicationId
不匹配。我使用的是最新版本的Android Studio(2.0预览版9)。错误本身清楚地解释了这里的错误:对于类型“segmentListType”的模式“[a-zA-Z0-9\-.]+.”无效。
只需在
应用插件:“com.android.application”
之前删除空间,然后再次重建项目。更新到最新版本后,我也遇到了这个问题。只需转到$ANDROID\u HOME/build tools/
并删除23.0.0 rc3目录即可修复错误。在更新ANDROID studio 2.0 beta 2和gradle之后,我也遇到了同样的问题。有关解决方案,请遵循以下步骤
完成。我使用最新版本,并将此
details.useVersion“25.3.0”更改为
details.useVersion '26.0.0'
它对我有效删除“应用插件:'com.android.application''之前的空格,然后重新构建项目,错误就会消失,因为它没有解决你的问题,所以你否决了它?甚至没有发布你的代码。