2

I tried numerous links, many answers like this. It just doesn't work. I have the android sdk build tools installed for the 22.0.1 but it still gives me the same error. Where have I gone wrong?

enter image description here

I seem to be getting this error as well in the gradle settings,

what and where should be the jdk?

Any kind of advice is appreciated.

hjpotter92
  • 78,589
  • 36
  • 144
  • 183
sameera sy
  • 1,708
  • 13
  • 19

4 Answers4

1

Make sure you have the android repositories up to date enter image description here

Raanan
  • 4,777
  • 27
  • 47
  • Yeah, they're updated!, Not sure why it doesn't work, thanks anyway – sameera sy Jan 04 '16 at 11:22
  • In the line that says SDK Location, if you click on edit is everything "ok" on the next screen? – Raanan Jan 04 '16 at 11:29
  • Regarding the gradle error, select "use default gradle wrapper" and see if that helps. Also that's not a valid Gradle distribution path but you JDK path. – Raanan Jan 04 '16 at 11:32
  • I did what you said, It says `Error:The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: C:\Users\Pavan\AppData\Local\Android\sdk\bin\java.exe` – sameera sy Jan 04 '16 at 11:32
  • That's not a valid java home path. – Raanan Jan 04 '16 at 11:34
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/99693/discussion-between-sameera-sy-and-raanan). – sameera sy Jan 04 '16 at 11:58
1

Make sure you have the SDK platform installed for API level 22.

Daniel Zolnai
  • 16,487
  • 7
  • 59
  • 71
  • Please check the screenshot that i have given, I have installed it. – sameera sy Jan 04 '16 at 11:32
  • Those are the build tools. You have to scroll down more for the platforms. Also first fix the Gradle error. Using the default wrapper should be fine for you. – Daniel Zolnai Jan 04 '16 at 11:33
  • I did those changes, when i select that Default wrapper option, it says `Error:The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: C:\Users\Pavan\AppData\Local\Android\sdk\bin\java.exe` – sameera sy Jan 04 '16 at 11:34
  • 1
    Make sure the JAVA_HOME environment variable is set correctly (http://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/). You have to restart Android Studio when you have set the variable. – Daniel Zolnai Jan 04 '16 at 11:37
  • The JAVA_HOME is set to the location specified in that gradle_home tab in the second screenshot. Now what do i do? – sameera sy Jan 04 '16 at 11:45
  • If you are on a 64 bit system, make sure you got the 64 bit AS and Java. Same for 32 bit. – Daniel Zolnai Jan 04 '16 at 11:49
0

I couldn't see any API's for 22 version on your pictures.But Error says you should download and reload your project with 22 API.

Buildtools is working correctly, your problem is about compileSdkVersion

Just what you have to do is, downloading 22 SDK Platform.

That's all.

for other questions, Please Search about them and fix your first problem and then look for solutions for others.

ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108
  • Thanks @LinX64 , But I do have it installed through the SDK manager for version 22. Not sure why it isn't seem to be working – sameera sy Jan 04 '16 at 11:48
  • yw.The first thing is you should update the repository as above users said, after that, you have to fix above errors and then check this currently error if it solved or not. – ʍѳђઽ૯ท Jan 04 '16 at 11:51
  • Trying it but it doesn't seem to be getting resolved. Thanks for all your help anyway! Really appreciate it. – sameera sy Jan 04 '16 at 12:45
  • It's my pleasure.can you please at least add a picture from your sdk manager with SdkPlatform(for checking that api 22) by the way? I hope you can fix it. – ʍѳђઽ૯ท Jan 04 '16 at 19:44
0

This is a gradle sync error - not a "gradle" error. Gradle sync is an Android Studio feature where it attempts to run gradle, and in your case it cannot find gradle, so when the sync attempts to process your build files, it fails with this weird error.

You are not pointing to a valid local gradle installation. You should download and install gradle locally, then update the section with an error to reflect the installed location. I have used gradle 2.2.1 and 2.7 (and some others, but they have caused problems). So be aware that the version of gradle you get may not be compatible with other features of your project, so you may need to try more than one.

Jim
  • 10,172
  • 1
  • 27
  • 36