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?
Related
I have a problem with Gradle. I'm trying to make a mod for Minecraft 1.12.2 and I'm using Intellij IDEA. Everything works fine for the version 1.16.4, but if I want to build a mod for the 1.12 I get this error:
Failed to apply plugin 'net.minecraftforge.gradle'.
Found Gradle version Gradle 7.4. Versions Gradle 6.0.0 and newer are not supported in FG3, FG4 however supports Versions 6.8.1 and newer. Consider upgrading.
It's supposed to do something with apply plugin: 'net.minecraftforge.gradle' in the build.gradle file.
I don't have much experience with this sort of stuff so please help me. Thanks in advance
to write a mod for 1.12.2, Forge provides a build.gradle file. In this, the 3.+ (FG3) is specified as the ForgeGradle version.
The current version of Gradle (7.4.2) only supports ForgeGradle versions from FG4 and newer.
FG3 - older than Gradle version 6.0.0
FG4 - Gradle version 6.8.1 and newer
You now have two options:
You take the Gradle version 7.4.2 and make a mod for a Minecraft version with a ForgeGradle version from FG4 or newer.
You take an older Gradle version.
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".
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
when running the gradlew build or gradlew install on my kotlin project, the following exception shows up in the console:
'use((T) -> R): R' is only available since Kotlin 1.2 and cannot be used in Kotlin 1.1.
Requires newer compiler version to be inlined correctly.
information:
the project is already configured to use Kotlin version 1.2.40.
the project seems to compile and run fine when i run it from my IDE (intelliJ)
what's wrong?
i ran into the same problem.
i updated update my Gradle version from 4.4.1 to 4.7 and then i could build my project with Gradle just fine.
if you are using the gradle wrapper, follow these steps:
visit the Gradle docs to find out what the latest version of Gradle is now.
in [project_root]/gradle/wrapper/gradle-wrapper.properties, use the latest Gradle version available for the distributionUrl property. for example, here is my gradle-wrapper.properties, using Gradle version 4.7:
#Fri Jun 02 20:20:27 PDT 2017
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
Months later, I encountered the same problem with a projet which is not up to date (still Kotlin 1.1.60), which suddenly stopped being compilable.
I resolved it by using the last version of Gradle Kotlin plugin (1.3.0 as I write).
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.+'