79641511

Date: 2025-05-28 04:43:53
Score: 0.5
Natty:
Report link
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}"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
Reasons:
  • Blacklisted phrase (0.5): medium.com
  • Long answer (-1):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: shivam sharma