Skip to content

fix: platform remove command fails with old Android runtime #3624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2018

Conversation

rosen-vladimirov
Copy link
Contributor

After upgrading nativescript-doctor, the version of the Java is
validated against the current Android runtime version. In case the
runtime version cannot work with Java 10, nativescript-doctor does not
allow the operation to continue. This breaks the platform remove
command, as it checks the system requirements first, before executing
the actual removal. However, this is no longer required as the code for
removing the platform is try-catched and in case the current
environment is not setup correctly, it will try to remove the
platforms/ dir and the respective key in package.json.
So remove the environment validation from this command. Also remove the
validatePlatformInstalled call from the canExecute method of the
command, as it is actually called in the removePlatforms method.

PR Checklist

What is the current behavior?

Trying to execute tns platform remove android on an older project, when Java version on local machine is 10, fails with error that you need to update your Android runtime version.

What is the new behavior?

You can successfully remove older platforms with tns platform remove android even when Java version is 10.

After upgrading `nativescript-doctor`, the version of the Java is
validated against the current Android runtime version. In case the
runtime version cannot work with Java 10, `nativescript-doctor` does not
allow the operation to continue. This breaks the `platform remove`
command, as it checks the system requirements first, before executing
the actual removal. However, this is no longer required as the code for
removing the platform is `try-catched` and in case the current
environment is not setup correctly, it will try to remove the
platforms/<platform> dir and the respective key in package.json.
So remove the environment validation from this command. Also remove the
`validatePlatformInstalled` call from the `canExecute` method of the
command, as it is actually called in the `removePlatforms` method.
@rosen-vladimirov rosen-vladimirov added this to the 4.1.0 milestone May 27, 2018
@rosen-vladimirov rosen-vladimirov self-assigned this May 27, 2018
@rosen-vladimirov rosen-vladimirov merged commit 47c4c70 into release May 28, 2018
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/fix-platform-remove branch July 13, 2018 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants