Skip to content

Commit cbf2ca0

Browse files
committed
Print warning when more than one package is produced from build
In case when productFlavors or split option is used in .gradle file more than on .apk files are produced. Print warning that will be used the last one produced from build.
1 parent 4948f83 commit cbf2ca0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/services/platform-service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,9 +788,13 @@ export class PlatformService extends EventEmitter implements IPlatformService {
788788

789789
private getLatestApplicationPackage(buildOutputPath: string, validBuildOutputData: IValidBuildOutputData): IApplicationPackage {
790790
let packages = this.getApplicationPackages(buildOutputPath, validBuildOutputData);
791+
const packageExtName = path.extname(validBuildOutputData.packageNames[0]);
791792
if (packages.length === 0) {
792-
const packageExtName = path.extname(validBuildOutputData.packageNames[0]);
793-
this.$errors.fail("No %s found in %s directory", packageExtName, buildOutputPath);
793+
this.$errors.fail(`No ${packageExtName} found in ${buildOutputPath} directory.`);
794+
}
795+
796+
if (packages.length > 1) {
797+
this.$logger.warn(`More than one ${packageExtName} found in ${buildOutputPath} directory. Using the last one produced from build.`)
794798
}
795799

796800
packages = _.sortBy(packages, pkg => pkg.time).reverse(); // We need to reverse because sortBy always sorts in ascending order

0 commit comments

Comments
 (0)