I am using android studio and i updated it from 2.3 to 2.3.3 and after when i am trying to open a existing project it is not gradlling. Here is my Application base build gradle file where i use dependencies like this...
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
}
In my gradle-wrapper.properties i have mention like this...
#Mon Jul 03 12:12:51 IST 2017
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
In My file>setting>gradle....
Follow the steps :
Go to your Project structure
Click on project on left side panel
Update the Gradle version to 3.3
Click on Ok Button
let it sync and you will be done
You can specify the Gradle version in either the File > Project Structure > Project menu in Android Studio, or by editing the Gradle distribution reference in the gradle/wrapper/gradle-wrapper.properties file. The following example sets the Gradle version to 3.3 in the gradle-wrapper.properties file.
distributionUrl = https\://services.gradle.org/distributions/gradle-3.3-all.zip
More information on gradle plugin:
https://developer.android.com/studio/releases/gradle-plugin.html
Related
Syncing gradle gives me this error:
Minimum supported Gradle version is 6.1.1. Current version is 5.4.1.
Please fix the project's Gradle settings.
Fix Gradle wrapper and re-import project
Open Gradle wrapper properties
Gradle settings
The Fix Gradle wrapper and re-import project option does nothing.
Here is my gradle.wrapper.properties file:
#Wed Aug 19 16:26:03 IST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
It has the right version yet I get Minimum supported Gradle version is 6.1.1. Current version is 5.4.1.
I'm on Mac OS 10.15.5 and Android Studio 4.0.1.
This image helps, in https://developer.android.com/studio/releases/gradle-plugin
eg:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1.2-bin.zip
in gradle-wrapper.properties
maps
classpath "com.android.tools.build:gradle:3.4.1"
in build.gradle
you need to make the relationship correct.
Update your gradle with:
gradle wrapper --gradle-version 6.6
I have trouble this same. This also not work for me
Here's how I fixed it
Download desired gradle release from Gradle official Create
New folder (Gradle) under C:\Gradle. Extract downloaded release here
Goto file->setting->Build, Execution, Deployment->Gradle
Use Gradle From Specified Location instead gradle.wrapper
Android Studio will auto-detect the path; if not choose manually
Sync project with Gradle file
i'm not able to build my project anymore and I'm getting some error regarding one of the catch files and specifically it takes me to a value called:layoutCron
i took some screenshots to the build console to show the error that happens when trying to build the project...
1-
2-
3-
4-
5-
when i try to go any further and find the file that they gave me it's path i find this :
the gradle version i'm using is 4.9 ...
with this in the project build gradle :
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0-alpha08'
classpath 'com.google.gms:google-services:4.1.0' }
Three steps to resolve the problem
Use a more stable gradle version as 4.4-all
Update Android Support Plugin version to 3.1.4
Rebuild Project
gradle-wrapper.properties file content:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Top-level build file: dependencies:
classpath 'com.android.tools.build:gradle:3.1.4'
Finally to show the effect clear gradle cache using File | Invalidate Caches/Restart
after doing that you won't have any problem in the build part
NOTE :
if android studio regenerated the files and gave you the same error afterwards you can just disable Aapt2 but that will only work till the end of 2018
you do that by adding android.enableAapt2=false
to the gradle.properties file .
I have tried many thing that is mentioned on the internet but still i am unable to resolve the issue ,while sync it's showing me following error
Error:Could not find com.android.tools.build:gradle:3.4.1.
Searched in the following locations:
file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom
file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.jar
Required by:
project :
I have changed the gradle-wrapper.properties in gradle of my projectlike this and sync the project
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip
First of all you should add the dependency in Project's build.gradle:
classpath 'com.android.tools.build:gradle:3.4.2'
And check all repositories groups that they contain google() repository:
repositories {
jcenter()
google()
}
After that in gradle-wrapper.properties you should change the distributionUrl:
https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
Downgrade your version com.android.tools.build:gradle:3.4.1. is not found in https://jcenter.bintray.com/com/android/tools/build/gradle/ repository.
Include the below classpath in your respective module.
classpath 'com.android.tools.build:gradle:2.2.3'
Or Download the latest gradle through the below
link
https://gradle.org/releases
and include the directory in your project setting.
Go to Android Studio -> Preferences -> Search for "Gradle" to open your gradle settings.
There you need to tick "Use local gradle distribution" and point it to the folder where the Gradle binaries live.
In case you haven't done that. Go here and download the latest Gradle binaries. Extract them somewhere in your machine and add the path of the extraction location as seen in the picture below :)
That should fix it
EDIT: This setting works in a "per-project" basis.
I just had to let Android Studio update a whole bunch of things like adding google to the repositories, upgrading the gradle wrapper and moving the android minsdk version from the manifest into gradle. Now it synced fine :)
I am trying to add a google services plugin for google sign in.
Syncing the project after adding some lines in the project level and the app level build.gradle files results in the following:
Gradle project sync completed with some errors
Accompanying message :
Warning:Gradle version 2.10 is required. Current version is 2.4. If
using the gradle wrapper, try editing the distributionUrl in
/home/vin***/Documents/Projects/F/gradle/wrapper/gradle-wrapper.properties
to gradle-2.10-all.zip
How do I resolve this?
Open your project folder in windows explorer and open gradle folder in it.
Go to wrapper folder, there you will find gradle-wrapper.properties file.
Its contents would be something like
#Wed Apr 10 15:27:10 PDT 2013
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
Change the distributionUrl's end to 2.10... or whatever your warning says.
Go to Settings => Build, Execution, Deployment => Gradle => choose Use default gradle wrapper
This is probably because you have set in you build.gradle
classpath 'com.android.tools.build:gradle:+'
You have to options:
Change your distributionUrl in your gradle-wrapper.properties to https\://services.gradle.org/distributions/gradle-2.10-all.zip
Change your build.gradle to an specific version like
classpath 'com.android.tools.build:gradle:1.3.0'
In my case I use the second one, because like you, I use gradle-2.4.
Hope this helps!!
This is the error I get:
Error:Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the distributionUrl in /Users/alinrosu/Workspace/passenger-android/gradle/wrapper/gradle-wrapper.properties to gradle-2.10-all.zip
I use this inside my buildscript:
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha5'
}
This is my gradle-wrapper.properties file:
#Tue Jan 05 13:28:23 CET 2016
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
As you can see. I use gradle version 2.10.
Do I need to refresh the cache somehow? I Tried clean, rebuild, but nothing works
You need set Use default gradle wrapper in
Settings > Builds,Execution,Deployment > Build Tools > Gradle >Project-level settings
I just changed mine
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha5'
}
for this
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
}
For me its working