Android Realm 4.3.1 Cannot change Gradle plugin version - android

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).

Related

Dynatrace Gradle plugin & Android Gradle plugin v7.2.x

In our Android project we just apdated the Android gradle plugin to 7.2.1
after that, we have this build issue
Dynatrace Gradle plugin detected a plugin that is blocking auto-instrumentation due to a bug in the Android Gradle plugin v7.2.x.
To resolve this issue, please revert to Android Gradle plugin v7.1.3 or switch to an updated version of the Android Gradle plugin.
Is this a knowen issue?
This is the Dynatrace plugin version I'm using
com.dynatrace.tools.android:gradle-plugin:8.+
Thank you in advance
This was fixed by using the AGP 7.3.0-beta-05

Failed to transform artifact com.twilio:video-android

After upgrading my Gradle plugin from the current version 3.5.3 to version 3.6.0 and Gradle to version 5.6.4, my project fails to build.
I get this error "Failed to transform artifact (com.twilio:video-android:5.1.0)"
how to fix this? When I revert my gradle version, it starts to build again, though some other things starts to annoy.
Fixed a bug where users of VideoView can not compile the SDK when
building with Android Gradle Plugin 3.6.0
You should use the latest version instead of the old.
implementation 'com.twilio:video-android:5.1.2'
Read SDK not compiling on AGP 3.6.0.

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.+.

relation between gradle version and gradle build tool version

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.

Categories

Resources