https://medium.com/@vortj/solving-namespace-errors-in-flutters-android-gradle-configuration-c2baa6262f8b
this worked form me i also added the link of medium article , you can refer the source
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace = project.group.toString() // Set namespace as fallback
}
project.tasks.whenTaskAdded { task ->
if (task.name.contains('processDebugManifest') || task.name.contains('processReleaseManifest')) {
task.doFirst {
File manifestFile = file("${projectDir}/src/main/AndroidManifest.xml")
if (manifestFile.exists()) {
String manifestContent = manifestFile.text
if (manifestContent.contains('package=')) {
manifestContent = manifestContent.replaceAll(/package="[^"]*"/, "")
manifestFile.write(manifestContent)
println "Removed 'package' attribute from ${manifestFile}"
}
}
}
}
}
}
}
}
}