Google released an updated version of Android Studio 3.5. After having updated to this version I get this warning below:
This project uses Gradle KTS build files which are not fully supported.
Some functions may be affected.
However, I believe this warning is restricted to developers who are using the Gradle’s Kotlin DSL to manage their dependencies. Instead of using groovy scripts.
Now android studio 4.0 is officially Support for Kotlin DSL script files(*.kts) so you need to update it and see the warning removed from your Event Log.
you can check below image and read from it official Document
Related
I'm getting this warning: 'Registrar' is deprecated. Deprecated in Java' any time I run flutter build apk. This is the error dialogue in android studio:
:\Users\df\Desktop\flutter.pub-cache\hosted\pub.dartlang.org\app_settings-4.2.0\android\src\main\kotlin\com\example\appsettings\AppSettingsPlugin.kt:16:48: warning: 'Registrar' is deprecated. Deprecated in Java
import io.flutter.plugin.common.PluginRegistry.Registrar
^
I run flutter build apk and this error always pop up
The warning you're seeing is indicating that the class 'Registrar' is deprecated in the app_settings library you're using (version 4.2.0). This means that the class is no longer recommended for use and may be removed in a future version.
This class is part of the Flutter plugin system and is used to register plugins with the Flutter engine. In the latest versions of Flutter, the plugin registration process has been updated and the Registrar class is no longer needed.
To resolve this warning, you can try updating to a newer version of the app_settings library that does not use the deprecated Registrar class. You can check the latest version of the library on the pub.dev website.
Alternatively, you can try using a different library that provides similar functionality and is compatible with the latest version of Flutter.
It's also good to check that your app's dependencies are up-to-date and that you have the latest version of the Android Studio and all the necessary dependencies installed.
You can also try cleaning and rebuilding the project and running the app on different emulators or devices to see if the issue is specific to the device you are currently testing on.
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.
To load a fresh APK I am required to clean every time before building. It is like the compiler isn't noticing my code changes.
Here are my configurations:
My project is entirely in Kotlin
Kotlin version 1.1.60
Gradle version 4.4
Android Build Tools version 3.1.0-alpha04
Android Studio 3.0 (stable)
Java 8
Databinding is enabled
Using Kapt
Instant run is disabled
I haven't confirmed if Java code would show the same problems or not.
Has anyone seen this and found a way around it?
I am getting this error while configuring kotlin plugin with Jack. I an using Android studio 2.3.2 currently.
Error:Kotlin Gradle plugin does not support the deprecated Jack toolchain. Disable Jack or revert to Kotlin Gradle plugin version
1.1.1.
If you are using latest IDE(3.0, preview version) it won't let you use Jack or you are using kotlin version above 1.1.1.
Jack has been deprecated because of the build time performance issue, It was mentioned in one of the session of google IO 2017. You can read this blog
In official documentation of Jack following warning is given:
The Jack toolchain is deprecated, as per this announcement. However, you may continue to use it to enable Java 8 language features until the replacement is available.
If you still want to use it, switch back you Android studio IDE to 2.3, and revert back to kotlin 1.1.1
EDIT
Kotlin by default supports Lambda expressions. If you want to use lambda expression in java with Kotlin also, you have to use Android Studio 3.0.
I am a newbie to Android programming. I am using Android Studio 1.1.0
I have following query regarding building an app using gradle.
What is the purpose of specifying buildscript dependencies 'com.android.tools.build:gradle:1.1.0' in build.gradle
What does this build statement actually do.
I have searched the forum but could not find anything specific on this.
However from some of the google search it seems to suggest that this statement might be required for the gradle script to download Android Plugin for gradle.
I find it surprising that though I am using Android Studio I still need to download Android Plugin for gradle. Should it not be coming in-built.
Appreciate your time and help
As the name suggest, "Android Build Tools" is a command line tools for building your Java source code (along with all the related assets) into executable APK file. It's located at your Android SDK directory (usually at $ANDROID_HOME) and can be updated using Android SDK manager (accessible via Android Studio IDE).
What is the purpose of specifying buildscript dependencies com.android.tools.build:gradle:1.1.0 in build.gradle
Android is using Gradle build system. That build script dependency is Gradle plugin to interact (compile, test, etc) with the Android Build Tools. That line declares that your project require Android's Gradle plugin version 1.1.0.
I find it surprising that though I am using Android Studio I still need to download Android Plugin for gradle. Should it not be coming in-built.
Android Studio (AS) is just an IDE, you can actually use any IDE that support Gradle build system. Android Build Tools and its Gradle plugin (it's not AS plugin) is constantly updated by the devs separated from Android Studio project (although it's pretty closely related). Moreover, different projects can requires different version of build tools and its Gradle plugins. So it's just make sense that Android Studio requires them to be downloaded independently from the IDE.