ponnamkarthik / FlutterToast

Toast Plugin for Flutter
MIT License
1.46k stars 366 forks source link

Support for Android Gradle Plugin 8.4 #541

Open taila-teq opened 1 month ago

taila-teq commented 1 month ago

After migrating the project to support Android 14, using Gradle 8.4. The FlutterToast not work anymore due to namespace problem

MarlonJD commented 1 month ago

To fix all namespace issues just edit your build.grade like this:

subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
    afterEvaluate {
        // check if android block is available
        if (it.hasProperty('android')) {

            if (it.android.namespace == null) {
                def manifest = new XmlSlurper().parse(file(it.android.sourceSets.main.manifest.srcFile))
                def packageName = manifest.@package.text()
                println("Setting ${packageName} as android namespace")
                android.namespace = packageName
            }
        }

    }
}

this will add namespaces to packages