Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Simple Android App (2014) Getting Started with Android Running the Fun Facts Project

Asaf Nakash
Asaf Nakash
3,206 Points

Gradle 'FunFacts' project refresh failed. Could not find any version that matches com.android.tools.build:gradle:0.12.+

when opening the android studio in windows 8.1 i get this error. i've tried many things including

  1. create a new project
  2. verify firewall settings
  3. open the fun facts project you provide 4.File -> Invalidate caches / Restart and rebuild.
  4. add Java\jdk1.7.0_67\bin directory to my PATH system variable.

nothing helped :( here is the full error:

Gradle 'FunFacts' project refresh failed Error:Error:Could not find any version that matches com.android.tools.build:gradle:0.12.+.

Required by:

:FunFacts:unspecified
Asaf Nakash
Asaf Nakash
3,206 Points

quick update, I re-tried "File -> Invalidate caches / Restart and rebuild" and after a few times it manage to download everything and resolve it selves.

I keep this discussion open in case somebody else is having the same problem.

3 Answers

you just have to make this two changes changes inside the build.gradle file. 1

 classpath 'com.android.tools.build:gradle:0.12.0'  

to

 classpath 'com.android.tools.build:gradle:1.0.0' //this is the minimum supported version of gradle now

2

After this you will also have to change runProguard to minifyEnabled

buildTypes {
    release {
        runProguard false // you have to change 'runProguard' to 'minifyEnabled ' 
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }

runProguard was renamed to minifyEnabled in version 0.14.0.

Source: http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0

I've done the invalidate and rebuild twice and get the same error. Windows 7. Android Studio 0.8.2.

Harry James
Harry James
14,780 Points

Hello there!

Could you please open your build.gradle file and make the following change:

// (-) DELETE THIS LINE: classpath 'com.android.tools.build:gradle:0.12.+'. Replace with below line \/
classpath 'com.android.tools.build:gradle:0.12.0'

This should fix your problem but if it doesn't, please paste your build.gradle contents onto here and I'll take a look :)

ok i deleted the line and added the new one. now here is what i get in build.gradle file:

apply plugin: 'com.android.application'

android { compileSdkVersion 19 buildToolsVersion "0.12.0"

defaultConfig {
    applicationId "ca.slabber.funfacts"
    minSdkVersion 14
    targetSdkVersion 19
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) }