5

I got this below error

Error:(1, 1) A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
   > Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the distributionUrl in C:\Users\TARUN\Desktop\GingerBuds\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip

Then I changed the above gradle path, Then following problem occurred,

I am getting this exception, while building my project . I rebuild and clean the project and updated google-play-services , then also i got error. can anyone please help me how to solve this.

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
java.io.FileNotFoundException: C:\Users\TARUN\Desktop\Gingerbuds\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.1"

    defaultConfig {
        applicationId "com.kitchenvilla.gingerbuds"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 24
        versionName "1.2.2"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

android {
    useLibrary 'org.apache.http.legacy'
}
android {
    publishNonDefault true
}


dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:recyclerview-v7:23.0.0'
    compile 'com.mcxiaoke.volley:library:1.0.15'
    compile 'org.apmem.tools:layouts:1.10@aar'
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.android.support:design:23.0.0'
    compile 'com.google.android.gms:play-services-maps:8.4.0'
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.android.support:support-v4:23.0.0'
    compile 'com.pkmmte.view:circularimageview:1.1'
    compile 'com.squareup.picasso:picasso:2.3.2'
    compile 'com.facebook.android:facebook-android-sdk:4.7.0'
}
Voora Tarun
  • 1,266
  • 1
  • 20
  • 38

5 Answers5

14

This bug has been fixed according to Google dev blog: http://tools.android.com/tech-docs/new-build-system

2.0.0-alpha6 (2016/1/15)
Instant Run 
Fix alpha5 reported issues :
    - cannot build when importing play-services.

You should update android gradle tools version

dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
}
ArL
  • 283
  • 5
  • 11
  • 1
    If you want the latest build tools this is the way to go. IMO this should be the accepted answer, as downgrading something is not much of a persistent solution. – McFarlane Jan 19 '16 at 08:30
  • I am still getting the following message after adding the dependency as described above `Error:Cause: failed to find target with hash string 'Google Inc.:Google APIs:23' in: D:\Android\sdk Open Android SDK Manager` – the_gesslar Feb 16 '16 at 05:30
3

This exception is thrown during a failed attempt to open the file denoted by a specified Path-name.

You can use

   compile 'com.google.android.gms:play-services:8.3.0'

Update your classpath

 classpath 'com.android.tools.build:gradle:2.0.0-alpha2'
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
2

this will solve it

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

and

compile 'com.google.android.gms:play-services:8.3.0'
user987760
  • 1,061
  • 3
  • 12
  • 26
  • 1
    This is a workaround (by using older versions), not a solution. The solution is to use gradle plugin version 2.0.0-alpha6 which fixes this problem, as answered by @ArL. – Jason Hartley Jan 21 '16 at 04:59
0

update gradle version to alpha9 in project level gradle file

classpath 'com.android.tools.build:gradle:2.0.0-alpha9'
Osman Goni Nahid
  • 1,193
  • 2
  • 15
  • 24
0

i tried to import admob ads to a new app i was making and i ran into this problem...... i found the solution the be the StartAppInApp file being located in the wrong spot or not being there..... my app needed the StartAppInApp-3.1.1.jar file to be located in the libs folder and when i looked at my app there was no libs folder located there at all .....

open your main app folder... then click app and you should have 3 folders.... src ... build.... and libs .....

in my case there was no libs folder..... so i created the libs folder and then went and copied the StartAppInApp-3.1.1.jar file from a different android project i had and i pasted it to the new libs folder i made in my current project... the error is now GONE!

i also made sure to include

compile files('libs/StartAppInApp-3.1.1.jar')

in the dependencies of my app gradle file

not sure if this is a solid answer but if anyone has this problem double check your StartAppInApp-3.1.1.jar location and version and check your gradle dependencies

skapaid
  • 169
  • 4
  • 17