From a0c3aae16d6ef405fd69c0ad1750f3cb868c78d4 Mon Sep 17 00:00:00 2001 From: Jakob Andersen Date: Fri, 24 Feb 2017 16:30:59 +0100 Subject: [PATCH] Read package ID and activity name from .apk for Gradle-based builds. (#8393) The gradle build scripts can be configured to output different application IDs for different build types, so we need to examine the built .apk to figure out the name of the package and activity. Fixes #8327 --- packages/flutter_tools/lib/src/application_package.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/flutter_tools/lib/src/application_package.dart b/packages/flutter_tools/lib/src/application_package.dart index b5dc498c8a..0ee8d15524 100644 --- a/packages/flutter_tools/lib/src/application_package.dart +++ b/packages/flutter_tools/lib/src/application_package.dart @@ -82,8 +82,9 @@ class AndroidApk extends ApplicationPackage { String apkPath; if (isProjectUsingGradle()) { - manifestPath = gradleManifestPath; - apkPath = gradleAppOut; + // Grab information from the .apk. The gradle build script might alter the + // application Id, so we need to look at what was actually built. + return new AndroidApk.fromApk(gradleAppOut); } else { manifestPath = fs.path.join('android', 'AndroidManifest.xml'); apkPath = fs.path.join(getAndroidBuildDirectory(), 'app.apk');