Shall I downgrade the installed version of Kotlin plugin in Android Studio? - android

I am getting a warning as I build an Android Kotlin w/ Jetpack compose app with Android Studio like this:
Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
.../transformed/jetified-kotlin-stdlib-jdk8-1.5.31.jar (version 1.5)
.../transformed/jetified-kotlin-stdlib-jdk7-1.5.31.jar (version 1.5)
.../transformed/jetified-kotlin-stdlib-1.6.10.jar (version 1.6)
.../transformed/jetified-kotlin-stdlib-common-1.6.10.jar (version 1.6)
The Kotlin version I am using with my project is 1.5.31, since It is compatible with Compose compile version 1.0.5.
The Kotlin plugin version installed on Android Studio is 1.6.10
Just for reference I am using Android Studio Bumblebee | 2021.1.1 Patch 1.
Shall I downgrade the plugin Kotlin version on Android Studio from 1.6.10 to 1.5.31?
Or, just ignore the warning? Other solution?

This have nothing to do with the plugin version you have installed. Probably some dependency of yours have kotlin 1.6.10 dependency and that's why you hvae this conflict. Try to find out which one using dependency tree - my recommendation is to use gradle scan, you can read about it here. In gradle scan results you can go through all of your dependencies in a tree, like here. You have to find which library is using newer kotlin and then use older version of that library that's targeting your kotlin version

Related

The project is using an incompatible version (AGP 7.3.0) of the Android Gradle plugin. Latest supported version is AGP 7.2.2

The project is using an incompatible version (AGP 7.3.0) of the Android Gradle plugin. Latest supported version is AGP 7.2.2
I am trying to open my team mate project.
change the version to 7.2.2 in gradle file as shown in the image
Update your Android Studio to Dolphin version.
For more, see this link.

This version of the Android Support plugin for IntelliJ IDEA

This version of the Android Support plugin for IntelliJ IDEA (or
Android Studio) cannot open this project, please retry with version
4.3 or newer.
The Gradle version is
classpath 'com.android.tools.build:gradle:7.0.0-alpha05'
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-all.zip
I'm using Android Studio Arctic Fox 2020.3.1 canary 10. I downgraded the Gradle to 7.0.0-alpha10 and it worked well.
Check your Android Studio Version (Help->About) e.g. 4.1.2
Update build.gradle class path to your version:
classpath 'com.android.tools.build:gradle:4.1.2'
where 4.1.2 is the version found under Help->About
Alternatively, you could just update your Android Studio Version to what is suggested.
JetBrains's support gave the similar answer as wandesky:
The message means that the Android plugin bundled with 2021.2 version
is not compatible with the Android Gradle plugin used by your Gradle
project:
com.android.tools.build:gradle:7.0.0
You will need to either use lower Gradle plugin version or use Android
Studio IDE to develop this project until IntelliJ IDEA merges latest
updates of Android plugin from the Android Studio IDE.
The classpath 'com.android.tools.build:gradle:4.2.1' should work fine
in 2021.2 IntelliJ IDEA.
(source)

Is it possible to use Android Gradle Plugin 3.0.0 with IntelliJ

I am trying to use plugin com.android.tools.build:gradle:3.0.0-alpha4 in IntelliJ.
But I've got the error
Error:This Gradle plugin requires Studio 3.0 minimum
The android gradle plugin version 2.3.3 supports Intellij.
I need IntelliJ due to I want to use AspectJ + Java 8 in IDE. Android Studio IDE doesn't support AspectJ yet, only gradle plugin.
Is it possible to use new version Android Gradle Plugin 3.0.0 with exactly IntelliJ, not Android Studio?
Thank you.
Android Studio 3.0 features will be merged in IntelliJ IDEA 2017.3.x which is not released yet, you can't update just Android plug-in separately, since it's a bundled plug-in and the synchronization with Android Studio is performed manually at JetBrains.
You can track the progress here.
As workaround you can add in gradle.properties this option:
android.injected.build.model.only.versioned=3
Full answer: https://stackoverflow.com/a/46634836/4050911
As the error states, you'll have to download Android Studio 3.0 (Canary) in order to use gradle plugin 3.0.0.
You need update your gradle version of both file Module level and Project Level as per the error '3.0.0' and then try to build the project

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.

Open project in Android Studio 1.0+ using gradle plugin 0.*.*

I am trying to open a Android Project in Android Studio 1.0.2 which uses
classpath 'com.android.tools.build:gradle:0.12.+'
as its dependency. On opening the project with above dependency I get the following error message.
The project is using an unsupported version of the Android Gradle plug-in (0.12.2). The recommended version is 1.0.0.
Is there a way to run such projects in Android Studio 1.0.+ without upgrading the Gradle plug-in version
Note:
I can upgrade the gradle version and plugin to get it to work OR simply use older version of Android Studio to open the project.
First approach is not desirable since this being a community project I will prefer to leave majority of files unchanged and changing gradle version will also hinder me from testing the build with 0.12.
To successfully build Android project using Android Studion and Gradle you need to use the AS, Gradle and Android Gradle Plugin with versions which are compatible with each other. Check out this page, it's said here, that you can use Android Gradle Plugin 0.12 with Android Studio 0.8.0 - 0.8.11 and there is no way to use it under Android Studio 1.0.
I suggest you convince other people to switch to the newest version of Android Gradle Plugin because 1.0.0 is the stable one and doesn't contain some bugs which were out there in the 0.12.+.

Categories

Resources