Don't read AndroidManifest.xml if it doesn't exit (#43669)

This commit is contained in:
Emmanuel Garcia
2019-10-29 16:05:13 -07:00
committed by GitHub
parent 53dcf92f7d
commit 7e60a65ff0
2 changed files with 386 additions and 366 deletions

View File

@@ -361,8 +361,11 @@ List<Map<String, dynamic>> _extractPlatformMaps(List<Plugin> plugins, String typ
/// [project] is using.
String _getAndroidEmbeddingVersion(FlutterProject project) {
assert(project.android != null);
final File androidManifest = project.android.appManifestFile;
assert(androidManifest.existsSync());
if (androidManifest == null || !androidManifest.existsSync()) {
return '1';
}
xml.XmlDocument document;
try {
document = xml.parse(androidManifest.readAsStringSync());