AndroidStudio - Gradle Update failed

I used the latest version of android studio to create my android app. The gradle shell installed the gradle installation, and the project was created without errors.

In the end, I started getting one error every time I restarted.

Gradle: There was a problem setting up the Application project.

Failed to resolve all dependencies for configuration ': App: classpath'. Failed to resolve com.android.tools.build: gradle: 0.5. +. Requires: Application: application: unspecified

org.slf4j.spi.LocationAwareLogger.log (Lorg / SLF4J / Token; Ljava / languages ​​/ String; ILjava / languages ​​/ String; [Ljava / languages ​​/ object; Ljava / languages ​​/ Throwable;)

The problem can be fixed by re-executing gradlew and the build went fine. But after updating the posters of studio 0.3 and Android to 0.6. + I cannot even execute gradlew without receiving this error message.

I tried to delete the android studio with all its configuration files, deleted the .gradle folders in the project and home directory and even in the .m2 repository. I can’t even start a new android project, it fails with the same error, so there should be no problems with my build.grade

buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.6.+' } } apply plugin: 'android' repositories { mavenCentral() } android { compileSdkVersion 18 buildToolsVersion "18.1.1" defaultConfig { minSdkVersion 15 targetSdkVersion 18 } sourceSets { main { manifest.srcFile 'src/main/AndroidManifest.xml' java.srcDirs = ['src/main/java'] res.srcDirs = ['src/main/res'] } } } dependencies { compile 'com.android.support:support-v4:18.0.0' compile 'org.jsoup:jsoup:1.7.2' } 
+6
source share
4 answers

I was able to solve the problem. I do not know what caused the error, but it is not there. Steps to fix:

  • Backing up and deleting an existing project
  • Uninstall Android Studio 0.3
  • Removing .gradle / and .androidstudio / in the user directory
  • Install Android Studio 0.2.X
  • Update android studio patches to 0.2.9
  • Reimport code backup
+1
source

This is a known issue http://tools.android.com/knownissues

The Android Gradle 0.6.2 plugin has been published with incorrect dependencies. It is not possible to remove it, so instead we will release 0.6.3, which fixes the problems. Just switch your version from 0.6. + Until 0.6.3 or run gradlew with -refresh-dependencies to force Gradle to look for an update.

 dependencies { classpath 'com.android.tools.build:gradle:0.6.+' } 

instead

 dependencies { classpath 'com.android.tools.build:gradle:0.6.3' } 
+1
source

Make sure you have the latest version of Gradle installed, since the latest version of Android Studio requires 1.8. Also, make sure you download the updates via the Android SDK that comes with Studio. Tools-> Android-> SDK Manager

You will need the latest Android support library

0
source

I encountered the same problem, after which I update my version responsible for the reaction: -

 react-native upgrade 

his work is beautiful for me now

0
source

Source: https://habr.com/ru/post/956364/


All Articles