Update android/build.gradle

This commit is contained in:
2026-09-14 11:54:58 +00:00
parent 5046a5bbff
commit 2b10550c12
+17
View File
@@ -28,3 +28,20 @@ subprojects {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
def androidExt = project.extensions.findByName('android')
if (androidExt != null && androidExt.hasProperty('namespace') && (androidExt.namespace == null || androidExt.namespace == '')) {
def manifestFile = project.file('src/main/AndroidManifest.xml')
if (manifestFile.exists()) {
def manifestText = manifestFile.text
def matcher = manifestText =~ /package="([^"]+)"/
if (matcher.find()) {
androidExt.namespace = matcher.group(1)
}
}
}
}
}
}