CleverTap / clevertap-flutter

CleverTap Flutter SDK
Other
32 stars 44 forks source link

How to add new gradle dependencies flutter 3.24 (Deprecated imperative apply of Flutter's Gradle plugins) #251

Closed innerk closed 1 month ago

innerk commented 2 months ago

Hi, recently we upgrade to flutter 3.24 and there are some changes on how to add gradle dependencies

EX:

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "{agpVersion}" apply false
    id "org.jetbrains.kotlin.android" version "{kotlinVersion}" apply false
    id "com.google.gms.google-services" version "4.4.0" apply false
    id "com.google.firebase.crashlytics" version "2.9.9" apply false
}
plugins {
    id "com.android.application"
    id "dev.flutter.flutter-gradle-plugin"
    id "org.jetbrains.kotlin.android"
    id "com.google.gms.google-services"
    id "com.google.firebase.crashlytics"
}

we tried to add the clevertap plugin to the gradle depencies in the new specific gradle way but with no luck, do you have any example?

Anush-Shand commented 2 months ago

@innerk You can follow the official flutter doc to migrate to the declarative plugins block

The example app from this github repository also uses the declarative plugins block. Please take a look at the same : https://github.com/CleverTap/clevertap-flutter/tree/master/example/android

Another useful link can be this stackoverflow thread : https://stackoverflow.com/questions/78032396/applying-flutters-app-plugin-loader-gradle-plugin-imperatively-using-the-apply-s#:~:text=Since%20Flutter%203.16%2C%20projects%20generated,need%20to%20be%20migrated%20manually.

Anush-Shand commented 1 month ago

Closing this due to inactivity. The above comment point to the required solution