Jalpesh Khakhi
Jalpesh Khakhi

Reputation: 298

Exception : mergeDebugResources in Android Studio

I got following Error if I try to add dependency in Top - level build.gradle file. This dependency is very much useful to add GCM in project without it GCM won't work:

Dependency :

classpath 'com.google.gms:google-services:1.5.0-beta2'

Error :-

Error:Execution failed for task ':app:mergeDebugResources'.
> Some file crunching failed, see logs for details

If I remove that dependency from top-level build.gradle the project compiles and run successfully.

If I add that file I got the error and Android Studio do not run project.

Please help me to get out of this error.

Edit Here is my project level build.gradle file:-

// 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:2.0.0-alpha6'
        classpath 'com.android.tools.build:gradle:2.0.0-beta5'
        classpath 'com.google.gms:google-services:2.0.0-beta5'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Upvotes: 1

Views: 136

Answers (3)

Vincy
Vincy

Reputation: 1078

in your Gradle log, if you're getting bad/invalid PNG file then take a look at my answer at Android Studio Gradle 2.0.0-alpha1 build errors

Hope this helps...

Upvotes: 0

prabhat yadav
prabhat yadav

Reputation: 93

Try this it should help.

buildTypes {
       release {
     multiDexEnabled true;
      }

 }

Upvotes: 1

Bhavesh Patadiya
Bhavesh Patadiya

Reputation: 25830

try Changing latest version of dependency from HERE:

classpath 'com.google.gms:google-services:2.0.0-beta5'

Also make sure you are setting correct Gradle plugin dependency as well in root project gradle file.

 classpath 'com.android.tools.build:gradle:2.0.0-beta5'

So, your final project build.gradle file will look like

dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0-beta5'
    classpath 'com.google.gms:google-services:2.0.0-beta5'
}

Upvotes: 1

Related Questions