![](/img/trans.png)
[英]org.xml.sax.SAXParseException android studio gradle error
[英]Gradle build error: SAXParseException
在構建應用程序時,我收到以下錯誤:
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'.
模塊級gradle的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 Preview 9)。
更新到最新的 gradle 后,我也遇到了這個問題。 只需轉到$ANDROID_HOME/build-tools/
並刪除 23.0.0 rc3 目錄即可修復錯誤。
我使用最新版本並將此details.useVersion '25.3.0'
更改為
details.useVersion '26.0.0'
它對我有用
錯誤本身清楚地解釋了這里的錯誤: is not facet-valid with respect to pattern '[a-zA-Z0-9_\\-;.]+' for type 'segmentListType'.
只需在apply plugin: 'com.android.application'
之前刪除空格並再次重建項目。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.