Gradle build error mac

When building a Hello World app on Mac, I get this error:

Error:Error: org.apache.xerces.dom.DocumentImpl cannot be cast to org.apache.xerces.dom.DeferredDocumentImpl Possible causes for this unexpected error include:

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

Any idea why this happens?

My Project build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
  buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
          // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
  allprojects {
    repositories {
        jcenter()
    }
}

My module build.gradle:

apply plugin: 'com.android.application'
  android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"
      defaultConfig {
        applicationId "com.example.user.myapplication"
        minSdkVersion 15
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
  dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
}