how to fix old gradle version? - android

I imported an old project from github to use it in a course, then I received this error message :
Support for builds using Gradle versions older than 2.6 was removed in tooling API version 5.0. You are currently using Gradle version 2.2.1. You should upgrade your Gradle build to use Gradle 2.6 or later.

I suggest you to update your versions to these:
/project/build.gradle
classpath "com.android.tools.build:gradle:4.1.3"
/project/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip

Related

In a ReactNative project ! Why My ANDROID Gradle versions are different

in Build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
where as in graddle-wrapper.properties, i have
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-all.zip
where these both are different?
Can they cause an error being different in version?
please brief me in details.Thank you.
First of all, both of those versions are extremely outdated. The latest stable version for the ditributionUrl is 4.x. The latest stable for the classpath is 3.3.0.
The difference is this: the distributionUrl is the actual version of the Gradle build system. The classpath is the version of the Android Gradle plugin, not Gradle itself.
The versions you have tell me that you're either using an outdated version of Android Studio, or you ignored the popups telling you a newer version of Gradle was required for the newer version of Android Studio. You should probably update Android Studio to 3.3.

All gms/firebase libraries must use the exact same version specification but firebase doc gave me different version

My Android Studio giving me an error see below images
but firebase doc gave me a different version of many libraries, here is the doc
So my question is if firebase doc gives me this different version of libraries then why is android studio giving me this error?
Upgrade the version of the version of the google services gradle plugin to the latest in you top-level build.gradle:
classpath 'com.google.gms:google-services:4.0.1'
This is the plugin that checks for proper versions. Only newer versions of this plugin understand the new versioning system of the libraries.
Use the following google service plugin:
classpath 'com.google.gms:google-services:4.0.1'
and upgrade firebase invites:
implementation 'com.google.firebase:firebase-invites:16.0.1'
As per one of comment suggested, Upgrading an Android Studio and Gradle version Did solve my problem, Previously I was using Android Studio 3.0 and after upgrading to Android Studio 3.1.3 this error was gone.
Below are the changes that I have made.
Updated Android Studio from 3.0 to 3.1.3
Updated Gradle Version to 4.4
If this will not fix your problem then try to upgrade your Google plugin version to the latest one
classpath 'com.google.gms:google-services:latest.version'

Cannot resolve AppCompatActivity after upgrade project from gradle 2.1 to 3.5

I successfully upgrade gradle from 2.10 to 3.5 to build APK in android studio 3, but have problem like this
And this is my build gradle
If you are going to update gradle version specially 3.1+ than you might need to upgrade support lib version too. its weird but it seems compatibility issues between gradle version and support lib version.

Android Realm 4.3.1 Cannot change Gradle plugin version

I use Realm 4.3.1. I found a question that is my Gradle plugin version auto updated. But my Gradle plugin version setting is 3.0.1 and when I build the project AndroidStudio tells me it is using Gradle plugin 3.1.0-Alpha3, ignoring my build tool version 25.0.3, as shown below.
So I removed Realm 4.3.1, and my Gradle plugin 3.0.1 works - this is my project build.gradle
That's a bug in 4.3.0 because of some trickiness with the maven publish plugin on the Realm side.
It was fixed in 4.3.2.
4.3.2 (2018-01-17)
Bug Fixes
Prevent Realms Gradle plugin from transitively forcing specific versions of Google Build Tools onto downstream projects (#5640).

Gradle build error in Android Studio

I am getting following error while building Android project in Android Studio 1.2.2 (fresh instalation)
Error:(76, 0) Could not find property 'unitTestVariants' on com.android.build.gradle.internal.dsl.TestOptions_Decorated#261be0aa.
Gradle version is 2.4
Android build gradle version is 1.2.3
Android-apt version is 1.4
Android SDK version is 19.
This is triggered by the Android apt plugin using the unitTestVariants property in its 1.5 version which is only available in the Android gradle plugin from version 1.3 onwards (cf. bug report).
So for now either use android apt plugin version 1.4, or Android gradle plugin version 1.3 (see instructions below).
Note that gradle version itself doesn't matter as far as this bug is concerned and you could use 2.4 as well as 2.2.1.
Use Android gradle plugin >= 1.3
make sure the projects buildscript block references jcenter() (the beta versions aren't on maven)
replace all instances of 'com.android.tools.build:gradle:1.2.3' by 'com.android.tools.build:gradle:1.3.0-beta4'
re-sync the gradle project from within AndroidStudio
Use Android apt plugin <= 1.4
(courtesy of #emarc-magtanong)
make sure all references to the Android apt plugin read com.neenbedankt.gradle.plugins:android-apt:1.4 and not com.neenbedankt.gradle.plugins:android-apt:1.5 nor com.neenbedankt.gradle.plugins:android-apt:+.
Use gradle 2.4. This happened to me as well and tried for it to work with gradle 2.2.1 changing the build tools and android gradle plugin. The only thing that worked was to update gradle. You can update the gradle wrapper.

Categories

Resources