# Gradle build error mac

**URL:** <https://discuss.gradle.org/t/gradle-build-error-mac/910>\
**Category:** Old Forum Archive\
**Created:** [January 30, 2015, 8:21pm UTC](https://discuss.gradle.org/t/gradle-build-error-mac/910 "2015-01-30T20:21:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Charle](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@John\_Charle](https://discuss.gradle.org/u/John_Charle)\
**Post date:** [January 30, 2015, 8:21pm UTC](https://discuss.gradle.org/t/gradle-build-error-mac/910/1 "2015-01-30T20:21:00Z")

</div>

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:

- Gradle’s dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)
- The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)

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:

```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:

```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'
}

```
