fix: platform remove command fails with old Android runtime #3624
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After upgrading
nativescript-doctor
, the version of the Java isvalidated against the current Android runtime version. In case the
runtime version cannot work with Java 10,
nativescript-doctor
does notallow 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 currentenvironment 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 thecanExecute
method of thecommand, 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.