简体   繁体   中英

Android Studio Gradle Error on Fresh Project (OS X)

I recently installed Android Studio on my Mac, as I planned on traveling this week, but I'm getting a very strange error when compiling even freshly made projects. I made sure jdk was up to date, and that all the right packages from the SDK Manager were downloaded, so I'm stumpted. This is the error I get every time:

Error:A problem occurred configuring root project 'LoLNexus'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:0.12.2.
     Required by:
         :LoLNexus:unspecified
      > org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V

Check your gradle

File -> Settings -> Gradle -> if using deault try to download 1.12 gradle version and set path for it

I got same projet on OS X just update

Update your build.gradle by changing gradle version there to 0.9.+.

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.9.+'
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM