mssaggoo.blogspot.in
mssaggoo.blogspot.in

Reputation: 121

Gradle build error: SAXParseException

on building the app, i get following error:

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 of module level 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'
}

The error remains even after cleaning the app. The structure of package does not match the applicationId described in gradle file. I am using latest version of Android Studio (2.0 Preview 9).

Upvotes: 3

Views: 3233

Answers (4)

Director Chuma
Director Chuma

Reputation: 1

I use latest version and I change this details.useVersion '25.3.0' to

details.useVersion '26.0.0' 

and it work for me

Upvotes: 0

Dhaval Jivani
Dhaval Jivani

Reputation: 9697

I have same problem after updating android studio 2.0 beta 2 and gradle. for solution please follow bellow steps

  1. Navigate to SDK Path.
  2. Open Build-tools directory.
  3. Remove 23.0.0-preview from build-tools directory.
  4. Rename build-tools-21.1.2 to 21.1.2

AndroidSdk  Build-tools directory

Done.

Upvotes: 8

am5a03
am5a03

Reputation: 587

I encountered this problem also after updating to latest gradle. Simply go to $ANDROID_HOME/build-tools/and remove the 23.0.0 rc3 directory fixed the errors.

Upvotes: 5

Aman Grover
Aman Grover

Reputation: 1641

The error itself clearly explains what is wrong here: is not facet-valid with respect to pattern '[a-zA-Z0-9_\-;.]+' for type 'segmentListType'.

Just remove the space before apply plugin: 'com.android.application' and rebuild the project again.

Upvotes: -3

Related Questions