Gradle keep on asking update and downgrade? - gradle

I keep on getting "Gradle Sync error" so i checked had version 1.8. updated to 1.10, then it said i need 1.9, so i downgraded to 1.9 it said i need 1.8, when i downgrade to 1.8 it says i need 1.9.
15:28:09 Failed to refresh Gradle project 'Calendar'
You are using Gradle version 1.8, which is not supported. Please use version 1.9.
Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)
Fix Gradle wrapper and re-import project Gradle settings
15:28:26 Failed to refresh Gradle project 'Calendar'
You are using Gradle version 1.10, which is not supported. Please use version 1.9.
Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)
Fix Gradle wrapper and re-import project Gradle settings
15:28:39 Failed to refresh Gradle project 'Calendar'
Gradle version 1.8 is required. Current version is 1.9. If using the gradle wrapper, try editing the distributionUrl in
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Android
Studio\gradle\wrapper\gradle-wrapper.properties to gradle-1.8-all.zip.
Please fix the project's Gradle settings.

Gradle 1.10 is not yet supported in AS, Android Tools Developer team is working on it and probably will be available in next release.
As of now make sure all your build.gradle files in the project using gradle 1.9 as dependency
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
}
Update :
Gradle 1.10 is now supported in Android studio after release 0.4.3, so going forward you can start using 1.10 plugin by using 0.8.+ in your classpath like this
classpath 'com.android.tools.build:gradle:0.8.+'

Related

Cannot locate a Guava Jar in the gradle distribution?

I have the following error while performing the gradle build command.
What went wrong:
Execution failed for task ':asciidoctor'.
> Cannot locate a Guava JAR in the Gradle distribution
I'm using macOS Big Sur.
I had the same issue on my system.
It appears the problem was the use of the "3.2.0" version of "asciidoctor" plugins. The gradle version I'm currently using is "7.2".
This is the plugins section that was causing the problem:
plugins {
id("org.asciidoctor.jvm.pdf") version "3.2.0"
id("org.asciidoctor.jvm.gems") version "3.2.0"
id("org.asciidoctor.jvm.convert") version "3.2.0"
}
The fix was just to update the versions of these plugins to the latest version, which is "3.3.2".

Is it possible to force Gradle to downgrade version of some dependency with particular extension

I have dependencies on several plugins in project. These dependencies are put in plugins directory during project build. Here is the example:
plugin 'com.company:some-plugin:1.0#msi'
plugin 'com.company:some-plugin:1.0#pkg'
Now it is time to upgrade plugin version but for some reason I want to keep version of plugin for Mac (pkg) unchanged:
plugin 'com.company:some-plugin:2.0#msi'
plugin 'com.company:some-plugin:1.0#pkg'
How can I do it? Regular force does not help. What I see now is that Gradle upgrades version of all dependencies without considering of extension.
P.S. I use Gradle 5.2

AndroidStudio 3.0 compatible gradle build tool

What is the highest version of
com.android.tools.build:gradle
that Android Studio 3.0 can support?
I'm currently using
classpath 'com.android.tools.build:gradle:3.1.0'
with gradle version 4.4.
I tried using
classpath 'com.android.tools.build:gradle:3.2.1'
but AndroidStudio warns about compatibility with gradle version 4.4, even when it's already set to 4.4. I tried using gradle 4.6, 4.10, but the warning keeps popping up. Is this a bug in AndroidStudio 3.0?
I'm asking this question because I'm trying to use androidx.databinding on AndroidStudio 3.0, and there hasn't been many results when googling this topic. Would appreciate any comments about this issue.
Thanks.
I have an Android project which is successfully building. I'm using the latest version of Android Studio (3.2.1), Gradle 4.7 and Gradle build tools 3.2.1. All working well.
build.gradle (buildscript subsection):
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
gradle/wrapper/gradle-wrapper.properties:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
So maybe your issue is that you need to upgrade your Gradle wrapper to download Gradle 4.7 instead?

IntelliJ's default gradle wrapper version - where is it configured

I have Gradle version 2.12 installed on my Mac OS. But when I create a new Gradle project from scratch using IntelliJ, and then select 'Use default gradle wrapper (recommended)', I see the project will be set up with a Gradle Wrapper that is version 3.1 - as in the gradle-wrapper.properties file.
I'd like to understand how IntelliJ chooses version 3.1 as the default version? I can't seem to find where it is configured.

Gradle tasks missing after bumping gradle version

I was previously using Gradle 2.3 and the Gradle Android plugin 1.3.1.
After upgrading to 4.0.1 and 2.3.0 respectively, my build fails with the following message:
Task with name 'packageReleaseJar' not found in project
Is there a compatibility problem between these versions of Gradle? I believe this is not a custom defined task.

Resources