Q:
After the flutter executes the command to upgrade the new version, there are the following problems when checking with the flutter doctor
command:
After typing the command according to the prompt, an error message appears again:
A:
after we upgrade the SDK, execute fluent doctor
, which prompts us to install the command line tools developed by Android. When we install the command line tool according to the prompt, the Java error is generally because we have installed a set of java version locally, but the Java version number is higher than 1.8, resulting in compatibility problems.
There are two ways to solve the problem. The first is to uninstall our own installed Java and reinstall a lower version of Java (1.8), but it is not recommended!
Since Android development can only use java version 1.8, the Android Studio development environment will bring its own Java virtual machine, so we don’t need to install an independent Java environment ourselves. Therefore, we actually don’t need to pay attention to our locally installed java version. We can directly open the Android studio tool and automatically install CmdLine tools
:
As shown in the figure above, check the tool and click OK to install it automatically. After installation, re execute the fluent doctor
command to solve the problem!
Official account: programming path from 0 to 1