diff --git a/lib/controllers/platform-controller.ts b/lib/controllers/platform-controller.ts index c78e7e27c6..2203c1a56e 100644 --- a/lib/controllers/platform-controller.ts +++ b/lib/controllers/platform-controller.ts @@ -114,8 +114,13 @@ export class PlatformController implements IPlatformController { projectData.projectDir, platformData.platformNameLowerCase as SupportedPlatform ); - // if no version is explicitly added, then we use the latest - if (!version && !desiredRuntimePackage.version) { + + if (version) { + desiredRuntimePackage.version = version; + } + + if (!desiredRuntimePackage.version) { + // if no version is explicitly added, then we use the latest desiredRuntimePackage.version = await this.$packageInstallationManager.getLatestCompatibleVersion( desiredRuntimePackage.name ); diff --git a/lib/services/platform/platform-validation-service.ts b/lib/services/platform/platform-validation-service.ts index 0ed35428ec..c29d96b9f8 100644 --- a/lib/services/platform/platform-validation-service.ts +++ b/lib/services/platform/platform-validation-service.ts @@ -54,7 +54,7 @@ export class PlatformValidationService implements IPlatformValidationService { ); if (!hasPlatformDirectory) { this.$errors.fail( - "The platform %s is not added to this project. Please use 'tns platform add '", + "The platform %s is not added to this project. Please use 'ns platform add '", platform ); }