Installation Win10 white flutter to 64

Pure white flutter installation process of writing wrong with also please correct me

EDITORIAL: there are many tutorials on the web flutter installed, some are very detailed, but in the course of my own installation error has appeared in a wide variety of security before ... probably because java and Android studio time messing up, so a lot of mistakes. And most of the existing tutorial long time, the new version is not suitable, feasible method so I speak here in March 2020 installed.

The process may be incomplete, it is recommended to eat with other tutorials.

Need to download / configuration stuff

  • JAVA JDK
  • Android Studio
  • Flutter Sdk
  • Visual Studio Code
  • ps Some things can not be over the wall over the wall of a friend may have to go look at other blog

General steps

  1. Installation and configuration java, Android Studio, flutter
  2. With flutter doctor cmd command continues to check in with a good environment if
  3. With a good thing except for virtual machines
  4. With Virtual Machine
  5. Installation and configuration VS Code (not VS) to write code

installation steps

1.JDK installation and configuration

(1) Baidu / Google search jdk8, choose the right version of the computer to download the exe file from GitHub, or link Baidu network disk. (8 Why is not the other versions, goes on to say)
(2) Double-click the downloaded installation, the default installation directory, note the directory where, for a while will be used.
(3) configured java path (4): Right-click My Computer -> Properties -> Advanced System Settings -> (Advanced) Environment Variables -> System Variables

  • New. Variable name: JAVA_HOME, variable values: your java sdk root directory. eg, C: \ Program Files \ Java \ jdk1.8.0_221. determine.
  • Find Path, double-click Path (if not on the New Path), click New, type% JAVA_HOME% \ bin; then click New, type% JAVA_HOME% \ jre \ bin. determine.
  • I also added CLASSPATH, but some article said no, just in case plus the total right. New. Variable name: CLASSPATH, variable values:;.% JAVA_HOME% \ lib \ dt.jar;% JAVA_HOME% \ lib \ tools.jar

(4) Check if java has a good job : win + r to open cmd, respectively, enter java, javac, java -version can appear something that looks very right, already with a good explanation java environment. Should be able to with a good, if not you can go to search with java environment configuration tutorial, there is too much ...

2.Android Studio installed(Later also configure something)

(1) Baidu / Google search Android Studio, version 3.6.
(2) Double-click the icon to download installation, the default option properly installed. Note To ensure that the directory sdk installed disk has enough space. Encounter problems, you can choose normal thinking. Select standard standard install time. AS during the install you want to download a lot of things, the process is slow, be patient.
(3) Configuration AS Environment Variables

  • Similarly (java) method to open system variables
  • New. Variable name: ANDROID_HOME, variable values: Android's sdk directory.

3.Flutter sdk download and install

(1) Baidu / Google flutter, click Flutter Chinese network, download the appropriate computer flutter archive.
(2) download a good position to extract extracting think, do not have Chinese directory with no spaces.
(3) Configuration flutter environment variables (just configure the java)

  • Similarly (java) method to open system variables
  • Double-click Path, New, enter the address of the next flutter bin directory. eg, C: \ comp \ flutter \ bin. determine.

(4) Check that flutter with a good : Enter flutter in cmd, can appear looks right thing.
(5) Configuration flutter domestic mirroring : In order to download content (not required)

  • Similarly (java) method to open system variables
  • New. Variable name: FLUTTER_STORAGE_BASE_URL, variable values: https: //storage.flutter-io.cn
  • New. Variable name: PUB_HOSTED_URL, variable values: https: //pub.flutter-io.cn

4.Android Studio Configuration

(1) Open the Android Studio, click on the bottom right corner of Configure, then click plugins plugins upper left corner of the input flutter search, you may want to click on the search in repositories, install, restart AS, you will see Start a new Flutter project in the second row
( 2) choose yes when asked whether to install Dart
(3) after rebooting, select the second entry is created flutter project, could be waiting for some time, not too long.
(4) Select Flutter Application, next
to modify project name, location and the like after (5).
(6) may Flutter SDK path in, even if you enter the correct address, could not find the problem. There may be two reasons. First flutter environment variable is not a good job, a good job on it. Second, there is a saying, flutter file is deleted in just a few operations, so you can re-extract the flutter. In theory, both of which are done to find sdk, but I'm partial to AS open in the second when they can not find a sdk ... So I opened the project for the first time created, go new, will be able to sdk find a ... do not know why
(7) has since been next to, I do not know what the domain name, the proposed reference other blog.
(8) successfully created flutter file, click the file, open, create a directory in the Android project click Open.
(9) for the first time will be very slow to open, file download gradle. Look at the bottom of prompt state. Then click on the file can not see a place called 'Sync Project with Gradle Files' options, note also download. If you can see, it is not a complete download is stuck, pay attention to see the bottom of the message. If stuck, indicating that speed may be a bit slow, click on this option, or check the network.

5.Cmd constantly calling flutter doctor to check whether with a good flutter

flutter doctor can either execute a command in cmd, can also run under the flutter flutter_console.bat directory. Front with flutter environment variable is to be able to open in cmd, if not, right-click the .bat file has been run as an administrator, enter flutter doctor will be able to. Enter flutter doctor, first take some time to download something, become fast behind. Then you can see the like of this picture
In order for him to become so fast I was tortured to death tvt
in front of the red circle, if a check mark on it, exclamation mark can not. Theoretically, then by step, wherein the second and fourth exclamation point, are the first and third check mark. The fourth is to say whether there are device (real machine or virtual machine) connection, usually after the fourth restart would be an exclamation point, need to connect again.
The second is an exclamation point, I encountered some errors like this:
Android License Status Unknown

  • Execution flutter doctor --android-licenses
  • If the message appears asking whether to accept the terms, then congratulations, you have to go to complete the implementation of y.

可能1:A newer version of the Android SDK is required. To update, run: C:\Users\tdmil\AppData\Local\Android\sdk\tools\bin\sdkmanager --update

  • First up cd into the bin directory and execute sdkmanager --update
  • In my case, there is a warning appears first file is not found, the online experience is built of the same name in the corresponding file directory can be empty, no longer warning.
  • Then for the first time while waiting for some time, appear done.
  • Then, I went back to the original directory, perform flutter doctor --android-licenses, it has emerged as a warning: A newer version of the Android SDK is required To update, run:. C: \ Users \ tdmil \ AppData \ Local \ Android \ sdk \ tools \ bin \ sdkmanager --update
  • Internet search found that seems to be open sdk manager at AS sdk directory to update, but I can not open sdk manager ... tried many ways does not work (of course, I was too dishes tvt)
  • Then found a way to universal!
  • Console input android update sdk --no-ui --filter build-tools-24.0.0, android-24, extra-android-m2repository carriage can then skip the update directly received; _;
  • Y has been going to be all right

可能2:Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule SchemaModuleVersion.(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
… 5 more

  • The reason this occurs is not with a good java, java configuration check
  • I was able to output a hello world java :) I went to check with a hammer
  • Java did not prove to be well, but the version is too high, lost some files
  • Recommend java8, because the missing file version is too high, too low version does not support = =

Here is not yet complete but also need to configure a virtual machine

6.virtual machine

Either with a virtual machine, you can also use on-device debugging, now I only use AS to build a virtual machine, of course VS Code of Baidu to find the virtual machine and real machine can
(1) enter the AS Click on the top right of the phone looks ADV manager icon
(2) Ruoyi virtual machine, run the small arrow to the right of the point
(3) if there is no virtual machines, the lower left corner to create a virtual machine

a mistake

Emulator: emulator: ERROR: Unknown AVD name [虚拟机名], use -list-avds to see valid list.

Emulator: Process finished with exit code 1

Solution: The default installation in C drive C: File \ Users \ username .android \ avd avd entire folder to the environment variable ANDROID_HOME folder can be referred to.
Then you can run a virtual machine

7.By entering code VS Code

At this point, the basic preliminary work done. Most online tutorials vs code written in the code, of course, AS can only account for a relatively large memory. vs code is relatively light.

Published an original article · won praise 0 · Views 2

Guess you like

Origin blog.csdn.net/weixin_39861428/article/details/105008304