1

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
}
Jalpesh Khakhi
  • 288
  • 4
  • 17

3 Answers3

1

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'
}
Bhavesh Patadiya
  • 25,740
  • 15
  • 81
  • 107
1

Try this it should help.

buildTypes {
       release {
     multiDexEnabled true;
      }

 }
prabhat yadav
  • 93
  • 2
  • 11
0

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...

Community
  • 1
  • 1
Vincy
  • 1,078
  • 1
  • 9
  • 16