14

I want to import Android project in Android Studio and this is where the problem begins: 1) If I set Gradle home and click OK, I get the info: enter image description here

2) And secondly, if I try to run project I get the message: enter image description here

Trying both ways result in displaying messages above. I have GRADLE_HOME, JAVA_HOME set correctly and ANDROID_HOME points to "sdk" directory in android-studio directory. Much appreciation for answer with the solution.

Dylan Corriveau
  • 2,561
  • 4
  • 29
  • 36
dawid gdanski
  • 2,432
  • 3
  • 21
  • 29

7 Answers7

13

Point to the folder <gradle root folder>/libexec. Things should start working.

Abhinav Manchanda
  • 6,546
  • 3
  • 39
  • 46
10

Ok, I missed to download some build tools for specified android version, arrgh.. Anyway, thank you for your interest and the answers. I am quite new to gradle and Android studio. I have been developing android apps with intellij so far.

That worked for me: 1. Open Android SDK Manager. 2. Make sure that "Build tools ..." libraries are downloaded and it should work properly.

dawid gdanski
  • 2,432
  • 3
  • 21
  • 29
  • Could you be more specific? – Eric Mill Apr 14 '14 at 20:20
  • 1
    @Konklone in my case I had `buildToolsVersion "19.0.1"` in `build.gradle` file, but had only 19.0.3 installed. So downloading 19.0.1 from SDK Manager made things work. (Most likely it would be enough to update `build.gradle` to use 19.0.3) – Alexander Malakhov May 01 '14 at 07:03
1

I'm going to respond to this cause I had a ton of problems.

what I did was in linux

in terminal

type "which gradle"

if there is a symlink follow this until you see where your gradle is located.

mine was located in the following.

/usr/lib/gradle/4.2/bin/gradle

so now just use

/usr/lib/gradle/4.2/lib is what you want to put in intelliJ

0

Try to use default gradle wrapper. Android studio will do everything correctly.

ishitcno1
  • 713
  • 9
  • 10
  • I actually tried every option. I figured out that I have set GRADLE_HOME improperly. Now I get only the message from the second pic. – dawid gdanski Nov 07 '13 at 15:21
0

I had the same problem (Cause: unexpected end of block data) while importing a project, and resolved by setting ANDROID_HOME. export ANDROID_HOME=/android_sdk_root_dir

SunnyShiny9
  • 66
  • 1
  • 7
0

I had a "Cause: unexpected end of block data" as well. What I did was installing the right SDK version for Android. Check your build.gradle file. In my case I needed API level 18:

android {
    compileSdkVersion 18
    buildToolsVersion "18.1"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 17
        versionCode 1
    }
...

}
Kumiho
  • 121
  • 4
0

I was facing the same issue, I went to http://gradle.org/gradle-download/ and downloaded the latest gradle. I then linked my project to the path where i had saved the gradle, and everything worked

Byron Kiriibwa
  • 159
  • 1
  • 6