[Android] Adds namespace to module build file templates (#126963)

Adds `namespace` to module `build.gradle` file templates.

Fixes https://github.com/flutter/flutter/issues/126403.
This commit is contained in:
Camille Simon
2023-05-22 19:48:40 -07:00
committed by GitHub
parent bc14fedb77
commit 31a665c3eb
5 changed files with 59 additions and 1 deletions

View File

@@ -24,6 +24,11 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
namespace '{{androidIdentifier}}'
}
compileSdkVersion {{compileSdkVersion}}
defaultConfig {
minSdkVersion {{minSdkVersion}}

View File

@@ -3,6 +3,11 @@ def flutterPluginVersion = 'managed'
apply plugin: 'com.android.application'
android {
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
namespace "{{androidIdentifier}}.host"
}
compileSdkVersion {{compileSdkVersion}}
compileOptions {

View File

@@ -30,6 +30,11 @@ group '{{androidIdentifier}}'
version '1.0'
android {
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
namespace '{{androidIdentifier}}'
}
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

View File

@@ -3,7 +3,8 @@
package="{{androidIdentifier}}"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET"/>
<application tools:node="merge">
<application
tools:node="merge">
<meta-data
android:name="flutterProjectType"
android:value="module" />