0

[![enter image description here][1]][1]enter image description here

I have modified the file .but still not working. Can you please tell exactly where I am going wrong. previously,It was showing error- Required gradle 1.10 , but currently using 2.8

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
Sourav
  • 91
  • 1
  • 6
  • 12

2 Answers2

1

Follow these steps:

  1. Go to Settings > Builds ,Execution , Deployment -> Build Tools -> Gradle and set Use default gradle wrapper

enter image description here

  1. Edit the Project\gradle\wrapper\gradle-wrapper.properties file and set the field distributionUrl with:

    distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip

  2. Move the gradle plugin outside the dependecies block and inside the buildscript block:

Somenthing like:

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
    }
}
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
  • Thanks .. I am trying it.. In distributionUrl it should be 2.10 or 1.10? – Sourav Mar 25 '16 at 08:08
  • Sir, It may be a silly question. Can you tell where to find the buildscript? or I need to write these lines by myself? I am not finding buildscript code inside build.gradle – Sourav Mar 25 '16 at 08:15
  • @Sourav usually the buildscript block is inside the top level file (the build.gradle file in the root of the project). About the gradle version you can use 2.10. – Gabriele Mariotti Mar 25 '16 at 08:33
  • Sir, Sorry for disturbing you again and again. Actually, i have imported this project from Eclipse Juno. I have updated my post with top level build.gradle file Image. There is no buildscript as you can see. – Sourav Mar 25 '16 at 08:43
  • @Sourav You can copy the part. In any case you can try to create a blank project to undestand better what I am writing. – Gabriele Mariotti Mar 25 '16 at 08:57
  • ok!!! Thank you so much for Your response. I will update you about it. Thanks a lot – Sourav Mar 25 '16 at 08:59
  • Sir, I did everything you said. Now the error coming is written below--- Error:The project is using an unsupported version of the Android Gradle plug-in (0.12.2). The recommended version is 1.5.0. Fix plugin version and sync project – Sourav Mar 25 '16 at 10:06
  • the version of the gradle plugin is exactly the number used in the buildscript block – Gabriele Mariotti Mar 25 '16 at 11:45
  • Thanks a lot. However, My app had other issues as well. Finally, It got solved. It took almost 8 hrs.. OMG!!! btw, /thanks for your help. SIr. – Sourav Mar 25 '16 at 16:11
0

It might help people like me-

  1. I was adding dependencies in the wrong gradle.build file.

  2. Later I placed .jar files in /lib folder and connected that to gradle.build

  3. I updated my Sdk as well.

Sourav
  • 91
  • 1
  • 6
  • 12
  • I followed above instructions given by- @Gabriele Mariotti Sir. That help me to actually find and solve the issue. – Sourav Mar 25 '16 at 16:14