Our project specifically uses some deprecated features and Kotlin so we have to use Gradle 6.1.1. On GitHub, the android studio build action automatically uses Gradle 7.0, how can we change this?
Our code is available at GitHub
Thanks!
You can switch to older version by updating your wrapper:
./gradlew wrapper --gradle-version=6.1.1
so it would be:
- name: Build with Gradle
run: |
./gradlew wrapper --gradle-version=6.1.1
./gradlew build
Related
I have a Gradle project that uses the wrapper. The project does not build because the wrapper currently uses Gradle version 7. I know the project will build if I downgrade to version 6.
The problem:
When I run ./gradlew wrapper --gradle-version 6.8, I get a build error. I checked with ./gradlew --version to confirm it's still on 7. That's ironic. That's exactly why I want to downgrade to version 6!
How can I downgrade in this situation.
I have recently bought a macbook and tried to install Gradle with brew install gradle
When I do gradle -v I get my Gradle specifications with no problem, bit when I try to run a Gradle task on my project I got this error:
org.gradle.api.tasks.SourceSetOutput.getClassesDir()Ljava/io/File;
On windows I usually compile the project by doing ./gradlew task_name, but the ./gradlew isn't working here on Mac OS.
What Im I doing wrong?
SourceSetOutput.getClassesDir() was deprecated in Gradle 4 and removed in Gradle 5. It's now SourceSetOutput.getClassesDirs(). I'm guessing you are running a newer version of Gradle on the macbook than you were running on the Windows box. A simple fix is to downgrade the Gradle version.
If you want to actually fix your build to work with Gradle 5+ I suggest you run with --stacktrace on the command line to find out what's using the old API (ie if it's your Gradle script or one of your plugins).
Perhaps a fix is as simple as upgrading one or two of your plugins to a new version which supports Gradle 5+
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 am unable to build the cuba platform plugin I am assuming because gradle cannot download the necessary artifacts. I set the proxy:
gradle -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8118
gradle -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8118
However, it still fails:
Am I missing something?
I must use gradlew which uses 3.1, version 3.1 does NOT work.
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.