Fix path name to discover debug apk on add2app builds (#117999)

This commit is contained in:
Gary Qian
2023-01-24 16:19:09 -05:00
committed by GitHub
parent d20dd9e4bf
commit 5dabe102a2
2 changed files with 90 additions and 1 deletions

View File

@@ -115,7 +115,13 @@ class AndroidApk extends ApplicationPackage implements PrebuiltApplicationPackag
}
if (androidProject.isUsingGradle && androidProject.isSupportedVersion) {
apkFile = getApkDirectory(androidProject.parent).childFile(filename);
Directory apkDirectory = getApkDirectory(androidProject.parent);
if (androidProject.parent.isModule) {
// Module builds output the apk in a subdirectory that corresponds
// to the buildmode of the apk.
apkDirectory = apkDirectory.childDirectory(buildInfo!.mode.name);
}
apkFile = apkDirectory.childFile(filename);
if (apkFile.existsSync()) {
// Grab information from the .apk. The gradle build script might alter
// the application Id, so we need to look at what was actually built.