[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:
@@ -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}}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user