ponnamkarthik/FlutterToast

Support for Android Gradle Plugin 8.4

Opened this issue · 1 comments

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

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