12

I am getting this error when I Run or Debug the app but when I build or clean my project there are no errors. It sounds strange but I've wasted my 4-5 hours searching for this but nothing was helpful. Error:

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.> java.io.FileNotFoundException: C:\Users\Saeed Jassani\Downloads\AppName\app\build\intermediates\exploded-aar\com.google.android.gms\play-services\8.4.0\jars\classes.jar (The system cannot find the path specified)

build.gradle file:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
    applicationId "com.example.app"
    minSdkVersion 9
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:support-v4:23.1.1'
}
Saeed Jassani
  • 1,079
  • 2
  • 11
  • 27

2 Answers2

16

You can fix this by using alpha6:

repositories {
    mavenCentral()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
}
Community
  • 1
  • 1
PHPedro
  • 176
  • 2
  • 7
1

Clean your project and add following dependencies in your project level build.gradle file

    dependencies {

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

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

    }
Anjul khanal
  • 147
  • 1
  • 6
  • First of all, the gradle android plugin should be specified at the project-level **build.gradle** file. Then, `google-services` dependency should be specified in the app's **build.gradle**. Should they be two separate files? – IgorGanapolsky Aug 22 '16 at 15:25