android – Gradle项目刷新失败(AS 0.8.2,Mac)

android – Gradle项目刷新失败(AS 0.8.2,Mac),第1张

概述有了一个空白的新项目,我得到了这个: Gradle 'HelloWorld' project refresh failed Error:Cause: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lan 有了一个空白的新项目,我得到了这个:

Gradle 'HelloWorld' project refresh Failed    Error:Cause: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V

在尝试构建时,我得到以下Gradle Build错误:

Error:A problem occurred configuring root project 'HelloWorld'.> Could not resolve all dependencIEs for configuration ':classpath'.   > Could not resolve com.androID.tools.build:gradle:0.12.+.     required by:         :HelloWorld:unspecifIEd      > org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V

这是AndroID Studio的全新安装,我的build.gradle看起来像:

buildscript {    repositorIEs {        jcenter()    }    dependencIEs {        classpath 'com.androID.tools.build:gradle:0.12.+'        // NOTE: Do not place your application dependencIEs here; they belong        // in the indivIDual module build.gradle files    }}allprojects {    repositorIEs {        jcenter()    }}

相关日志错误的第一行是:

org.gradle.tooling.BuildException: Could not run build action using Gradle distribution '@R_502_6822@://services.gradle.org/distributions/gradle-1.12-all.zip'.Caused by: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring root project 'HelloWorld'.Caused by: org.gradle.API.ProjectConfigurationException: A problem occurred configuring root project 'HelloWorld'.Caused by: org.gradle.API.artifacts.ResolveException: Could not resolve all dependencIEs for configuration ':classpath'.Caused by: org.gradle.API.internal.artifacts.ivyservice.ModuLeversionResolveException: Could not resolve com.androID.tools.build:gradle:0.12.+.Caused by: java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V

项目结构只是具有空白活动的新项目的默认值:

解决方法 对我来说,它看起来像不兼容的版本.所以这个问题与这个问题有关: Android Studio says to use Gradle 1.10 – but new version is 1.12?

尝试使用gradle 1.10并删除gradle包装器的文件夹.

总结

以上是内存溢出为你收集整理的android – Gradle项目刷新失败(AS 0.8.2,Mac)全部内容,希望文章能够帮你解决android – Gradle项目刷新失败(AS 0.8.2,Mac)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1127647.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存