google play services 8.4.0 - 找不到classes.jar - android studio

时间:2016-01-15 14:50:49

标签: android android-gradle google-play-services

我在运行或调试应用程序时收到此错误,但是当我构建或清理项目时没有错误。这听起来很奇怪,但我浪费了4-5个小时来寻找这个,但没有任何帮助。 错误:

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文件:

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

2 个答案:

答案 0 :(得分:16)

您可以使用alpha6:

解决此问题
repositories {
    mavenCentral()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
}

答案 1 :(得分:1)

清理项目并在项目级build.gradle文件中添加以下依赖项

    dependencies {

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

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

    }