2

I am pretty new to the android programming. I had programmed a test app 1 year ago on eclipse. Now there is android studio and I wanted to try this because it looked nice and useful.

After installing, I ran into some problems even if everybody said its so easy to do this... It wasn't for me until now! but that's my personal luck, i always run into some weird issues :)

What I've done until now:

  • I have downloaded JDK (jdk-7u51-windows-i586) and installed it
  • I have downloaded and installed Android Studio (AS) + upgrade to AS-Version 0.4.6.
  • I have set JDK_HOME under sysvars to C:\Program Files\Java\jdk1.7.0_51

First running AS said I'm using the wrong supportversion... Didn't know what exactly it was then I tried to debug my error with gradlew clean build in console.

tried to change

dependencies {
    compile 'com.android.support:gridlayout-v7:19.0.1'
    compile 'com.android.support:appcompat-v7:+'
    compile 'com.android.support:support-v4:18.0.0' <===
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

into

dependencies {
    compile 'com.android.support:gridlayout-v7:19.0.1'
    compile 'com.android.support:appcompat-v7:+'
    compile 'com.android.support:support-v4:19.0.1' <===
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

which seems to solve my problems until there...

but is still have this error:

Gradle project sync failed. 
Basic functionality (e.g. editing, debugging) will not work properly.

and

Gradle 'ProjectName' project refresh failed: 
A fatal exception has occurred. Program will exit.

I tried THIS with no results

Can someone help me with that?

Additional informations:

  • Google Reposetory 6 and Android Support Library 19.0.1 are installed.

  • Terminal (ProjectFolder): gradlew clean build

    Results:

    Ran lint on variant release: 12 issues found

    BUILD SUCCESSFUL

  • Gradle Version: gradle-1.10-all

Community
  • 1
  • 1
Dwza
  • 6,494
  • 6
  • 41
  • 73
  • What are the errors you're seeing when this happens? – Scott Barta Mar 03 '14 at 14:16
  • I wrote them in my post. last 2 errors – Dwza Mar 03 '14 at 14:40
  • can you please update which version of gradle are you using in your build.gradle files ? Also check default gradle wrapper selected in File > Settings > Gradle . – Piyush Agarwal Mar 03 '14 at 15:02
  • updated, its the `1.10-all` and yes default wrapper is checked. where can i see the used gradle file ? i have several build.gradle files... – Dwza Mar 03 '14 at 15:13
  • I had the same problem with the same error message that you are getting. Have a look at my answer here: http://stackoverflow.com/questions/21066598/android-studio-0-4-2-gradle-project-sync-failed-error. Also I think you need to have a GRADLE_HOME sysvar defined Unless you have done it already and didn't mention it in your question). Good luck. – Carlos Taylor May 15 '14 at 07:02
  • actually i just delete JAVA_HOME from the ENV and it seemed to solve the problem :D and i read the post you just gave me befor – Dwza May 15 '14 at 14:36

1 Answers1

0

If you want to use automatic gradle magic you have to download first google repository and android support repository shrough SDK manager (an icon on the top of AS widow - android with down arrow).

piotrpo
  • 12,398
  • 7
  • 42
  • 58
  • i know whats the sdk manager :) both installed, still having this issue (GR6 and ASL19.0.1) – Dwza Mar 03 '14 at 14:39