[flutter_tools] Add namespace getter in Android project; use namespace as fallback (#121416)
[flutter_tools] Add namespace getter in Android project; use namespace as fallback
This commit is contained in:
@@ -171,7 +171,10 @@ class AndroidApk extends ApplicationPackage implements PrebuiltApplicationPackag
|
||||
logger.printError('Please check ${manifest.path} for errors.');
|
||||
return null;
|
||||
}
|
||||
final String? packageId = manifests.first.getAttribute('package');
|
||||
|
||||
// Starting from AGP version 7.3, the `package` attribute in Manifest.xml
|
||||
// can be replaced with the `namespace` attribute under the `android` section in `android/app/build.gradle`.
|
||||
final String? packageId = manifests.first.getAttribute('package') ?? androidProject.namespace;
|
||||
|
||||
String? launchActivity;
|
||||
for (final XmlElement activity in document.findAllElements('activity')) {
|
||||
|
||||
Reference in New Issue
Block a user