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.+.
Related
So let's say I have an application on android studios using Gradle version 4.1 with Gradle plugin version of 3.0. I have added implementation 'com.facebook.android:facebook-login:8.2.1' to my build.gradle file. However com.facebook.android:facebook-login:8.2.1 is using Gradle version 4.4.
So the only way for me to use this library (and that version) is if my project is on Gradle version 4.4 or greater?
Or is there a way for me to use that library (and that version) without changing my Gradle version?
Thanks.
Update: More Info
So specifically I am talking about using the stripe API. I was on version 6.1.2 but because of some new EU law, I need to update the version I am using to at least 9.1.1.
I noticed the only time I get this error 'apptransformClasseswithdesugarfordebug' when trying to run my app, is after they update there Gradle to use version 3.4.1 from 3.4.0 (not the Gradle plugin). On version of Stripe 9.0.0, my app is able to run, however, after switching to version 9.1.1, I get that error.
Note, my project is on Gradle version 3.1.4 and when it's on Stripe version of Gradle 3.4.0, my app is able to run.
So to wrap it up, I need to know if I need to be on the same version, although I doubt it because my app works with 9.0.0 of Stripe, which is using a different version of Gradle.
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
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.
I'd like to use the latest version of Gradle in Android Studio. How do I check which version is used, and how do I upgrade to the latest one (if it is supported)? I would like to upgrade because I read that the latest version of Gradle improves build times.
You can check current Gradle version in Project Structure (File -> Project Structure...).
You can change default Gradle by using local distribution. However, I am not sure if Android Studio can support Gradle 2.4. Maybe you can have a try. Or you can change gradle-wrapper.properties directly.
I'm new to gradle and got 2 questions:
gradle itself is a build tool, so why is the need for Android gradle tool com.android.tools.build:gradle:0.7.+ in the script?
What is the relation between the version of gradle installed (say 1.9) and the version of that Android gradle tool, like 0.7.+ in classpath 'com.android.tools.build:gradle:0.7.+'. If I changed the latter's version to 0.8.+ then the build fails on 'could not find plugin AppPlugin'.
1) Gradle is a build tool, but it requires specific plugin to work.
Android Tool Team is releasing the Android plugin for Gradle.
com.android.tools.build:gradle:0.6.+
com.android.tools.build:gradle:0.7.+
com.android.tools.build:gradle:0.8.+
Here you can find the repo:
https://android.googlesource.com/platform/tools/base/
The current dev branch is idea133. Otherwise you can check gradle_0.8/gradle_0.7 branches.
2) There is a relation between gradle-plugin and the gradle version.
For example
com.android.tools.build:gradle:0.6.+ -> gradle 1.8
com.android.tools.build:gradle:0.7.+ -> gradle 1.9
com.android.tools.build:gradle:0.8.+ -> gradle 1.9/1.10
You can find gradle version used in your project in the file gradle/wrapper/gradle-wrapper.properties
Also there is a relation between gradle-plugin and the IDE version.
For example:
Android Studio 0.3.x -> gradle-plugin 0.6
Android Studio 0.4.x -> gradle-plugin 0.7
Android Studio 0.4.3+ -> gradle-plugin 0.8
For updated news you can check this link: http://tools.android.com/recent
You can also check this updated post:
Android Studio Gradle issue upgrading to version 0.5.0 - Gradle Migrating From 0.8 to 0.9 - Also Android Studio upgrade to 0.8.1
If you change your plugin version, check compatibility, and then click sync project with your gradle files.It will download a new plugin version if you need it.
I will try to answer your questions.
As you said, Gradle is a build tool, but the line you have mentioned in your first question is referring to Gradle Java plugin version. Gradle has plugin for building Java projects. These plugins extend upon the general purpose build tool Gradle is, and may provide additional features. You can read more about the Gradle plugins here.
The reason your build fails when you change the plugin version is simple, the plugin version 0.8 is not there. There is a relationship between Gradle version and the plugin version and a developer has to maintain that. You can only use a plugin version which has been released and is compatible with the Gradle version. I hope the answer to first question answers this anyways.