Problem migrating the new Gradle of the latest version of Flutter

I have a project with Flutter 3.10.3, and when trying to migrate to the latest version, 3.22, I was able to run everything correctly on iOS, but for Android, it shows an error. I followed the Gradle migration according to the documentation –> https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply

However, it is showing the following error:

Plugin project :file_selector_linux listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :file_selector_macos listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :file_selector_windows listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :firebase_core_web listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :geocoding listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :geocoding_ios listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :geolocator listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :geolocator_apple listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :geolocator_web listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :geolocator_windows listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :image_cropper_for_web listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :image_picker listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :image_picker_for_web listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :image_picker_ios listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :image_picker_linux listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :image_picker_macos listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :image_picker_windows listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :path_provider_linux listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :path_provider_windows listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :shared_preferences listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :shared_preferences_foundation listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :shared_preferences_linux listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :shared_preferences_web listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :shared_preferences_windows listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :url_launcher listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :url_launcher_ios listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :url_launcher_linux listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :url_launcher_macos listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :url_launcher_web listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :url_launcher_windows listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :video_player listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :video_player_avfoundation listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :video_player_web listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :webview_flutter listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
Plugin project :webview_flutter_wkwebview listed, but not found. Please fix your settings.gradle/settings.gradle.kts.
../../../.pub-cache/hosted/pub.dev/oktoast-3.3.1/lib/src/widget/oktoast.dart:101:26: Error: The getter 'bodyText2' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../development/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'bodyText2'.
        defaultTextTheme.bodyText2?.copyWith(
                         ^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/get-4.6.5/lib/get_navigation/src/extension_navigation.dart:222:62: Error: The getter 'backgroundColor' isn't defined for the class 'ThemeData'.
 - 'ThemeData' is from 'package:flutter/src/material/theme_data.dart' ('../../../development/flutter/packages/flutter/lib/src/material/theme_data.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'backgroundColor'.
                  TextStyle(color: confirmTextColor ?? theme.backgroundColor),
                                                             ^^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/cristianobonetti/development/flutter/bin/flutter'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s

As mentioned above, I used the documentation from https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply as a reference. However, I don’t know what I’m doing wrong. Here is the code from my

android/settings.gradle:

// include ':app'

// def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
// def properties = new Properties()

// assert localPropertiesFile.exists()
// localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }

// def flutterSdkPath = properties.getProperty("flutter.sdk")
// assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
// apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"

// def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()

// def plugins = new Properties()
// def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
// if (pluginsFile.exists()) {
//     pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
// }

// plugins.each { name, path ->
//     def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
//     include ":$name"
//     project(":$name").projectDir = pluginDirectory
// }

pluginManagement {
    def flutterSdkPath = {
        def properties = new Properties()
        file("local.properties").withInputStream { properties.load(it) }
        def flutterSdkPath = properties.getProperty("flutter.sdk")
        assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
        return flutterSdkPath
    }()

    includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "7.4.2" apply false
    id "org.jetbrains.kotlin.android" version "1.8.10" 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
}

include ":app"

Also, here is my android/build.gradle:

// buildscript {
//     ext.kotlin_version = '1.8.10'
//     repositories {
//         google()
//         jcenter()
//     }

//     dependencies {
//         classpath 'com.android.tools.build:gradle:7.4.2'
//         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10"
//         classpath 'com.google.gms:google-services:4.3.15'
//         classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.5'
        
//     }
// }

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
    delete rootProject.buildDir
}

And my android/app/build.gradle:

// buildscript {
//     repositories {
//         maven { url 'https://plugins.gradle.org/m2/' } // Gradle Plugin Portal
//     }
//     dependencies {
//         classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.10, 0.99.99]'
//     }
// }

plugins {
    id "com.android.application"
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin"
    id "com.google.gms.google-services"
    id "com.google.firebase.crashlytics"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

// def flutterRoot = localProperties.getProperty('flutter.sdk')
// if (flutterRoot == null) {
//     throw  GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
// }

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '10'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0.8'
}

// apply plugin: 'com.android.application'
// apply plugin: 'kotlin-android'
// apply plugin: 'com.google.gms.google-services'
// apply plugin: 'com.google.firebase.crashlytics'

// apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
    namespace "app.myapp.client"
    compileSdkVersion 34
    ndkVersion "23.0.7599858"

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
        checkReleaseBuilds false
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "app.myapp.client"
        minSdkVersion 21
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true
    }

    signingConfigs {
       release {
           keyAlias keystoreProperties['keyAlias']
           keyPassword keystoreProperties['keyPassword']
           storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
           storePassword keystoreProperties['storePassword']
       }
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            profile {
                matchingFallbacks = ['debug', 'release']
            }
            minifyEnabled true
            shrinkResources false

            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            
            signingConfig signingConfigs.release
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    // implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.10"
    implementation platform('com.google.firebase:firebase-bom:32.1.0')
    implementation 'com.google.firebase:firebase-analytics-ktx'
    implementation 'com.google.firebase:firebase-messaging-ktx'
    implementation 'com.google.firebase:firebase-dynamic-links'
    implementation 'com.google.android.gms:play-services-base:18.2.0'
}




Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật