Android studio 2.3 refreshing continuously - android

I've recently updated android studio to 2.3...After update it is continuously refreshing the project.So I clicked on invalidate cache and restart..After that it is showing this error
This is the error image
This is my build.gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is my gradle-wrapper.properties file
#Mon Mar 13 16:42:48 IST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
This is my gradle location
C:/Program Files/Android/Android Studio/gradle/gradle-3.2
Everything seems to be good to me.I dont know what should I change...Please help me

Click on the blue link - Upgrade Gradle Wrapper - that should fix it

For those who face similar problem here is the solution.Download gradle files manually from internet which is of around 80 mb and replace these new files with those of old ones in android stuido.

Related

Failed to apply plugin 'com.github.dcendents.android-maven'. Android studio failing to sync Gradle Project

I'm having trouble with my project in Android Studio and was wondering if somebody could help please so I can get it to successfully sync again. I'm sure it has recently updated and now I am unable to sync my project with the following error code:
Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin 'com.github.dcendents.android-maven'.
My build.gradle file is:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My gradle-wrapper.properties file is:
#Mon Nov 29 21:26:29 GMT 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Please let me know if there are any other files you need, or any additional info you require. As always, your help and expertise is greatly appreciated by me!
Thank you!

Could not find com.android.tools.build:gradle:4.0.0

gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
gradle-wrapper
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Could not find com.android.tools.build:gradle:4.0.0.
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.0/gradle-4.0.0.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/4.0.0/gradle-4.0.0.pom
I struggled in a similar question after upgrading the Android Gradle Plugin Version from 3.3.0 to 4.0.0 of a React Native project as suggested by Android Studio. I followed the answer but it still do not sync correctly.
Finally I run rm -rf node_modules and re-install all the dependencies by npm install. After that I sync again and it sync correctly. I guess that there are some caches in different node modules that are not cleaned properly. I hope if someone encounter similar problem can try and see if my answer fix the problem.
I faced this issue after Invalidating caches under File -> Invalidate Cache/Restart
Later deleted node_modules under project folder and then did an npm install.
On Click of File -> Sync Project with Gradle Files resolved this issue

Using an unsupported version of Gradle

When generating the APK I'm getting the error: The project is using an unsupported version of gradle. I'm working with Android Studio 3.5 version.
I've tried to change build gradle classpath to match distributionUrl in gradle-wrapper.properties but the error persists.
First, in Project-level settings, Use default gadle wrapper is selected.
Build.gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Gradle-wrapper file:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
The project is using an unsupported version of Gradle.
Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)
from the look of things you're using a very old version of gradle which might have been depreciated, an upgrade of gradle could solve this issueclasspath 'com.android.tools.build:gradle:3.4.2' and distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

grade sync failed when i want to import a project

i want to import a project in to android studio but i have an error gradle sync failed .
this is my build.gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Gradle sync failed: Cause: com.android.build.gradle.tasks.factory.AndroidJavaCompile.setDependencyCacheDir(Ljava/io/File;)V
Consult IDE log for more details (Help | Show Log)
i changed the distributionUrl but doesn't solve the problem .
my gradle-wrapper propertice:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
i searched the net for 3-4 hours but there was no solution for my problem that can solve my problem .
Hope it works
File → Settings → Build, Execution, Deployment → Instant Run and uncheck Enable Instant Run.

Android studio Gradle Wrapper Incompatible version

Issue. Every time we update android studio and tools we end up on a new version of the gradle pluging. The team has to manually update the build.gradle every time we switch branches.
Solution use gradle wrappers. However it is failing to work giving us this incompatible error. The wrapper in past experiences would download the version we want and just work. Why are we getting this incompatible version?
Most of us use canary channels for studio and tools. However we want the build.gradle to be the same for all of us and not to have to mess with it.
Specifically I do not want to have to update
classpath 'com.android.tools.build:gradle:2.2.0-alpha7'
I also want to avoid using something like gradle:2.2+ as the goal is to have everyone on the same set of tools.
Top most build.gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
task wrapper(type: Wrapper) {
gradleVersion = '2.2' //version required
// distributionUrl = distributionUrl.replace("bin", "all")
}
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0-alpha7'
// Per https://github.com/JakeWharton/butterknife
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

Categories

Resources