This is the 20th day of my participation in the November Gwen Challenge. Check out the details: The last Gwen Challenge 2021

No matter what language you’re learning, the first program is Hello World! Xiao CAI has been studying Flutter recently, so I want to sort out some of the problems I encountered in my first test Demo.

Reference: Flutter Chinese website

In field diagram

  1. Open AndroidStudio -> Start a new Flutter project to create a new Flutter project.

2. Fill in the project information.Project nameThe project name must be lowercase or lowercase with underscores, as shown:

3. Normally, fill in the project name and project path, but the tip here indicates that the Flutter SDK path is not given, as shown in the figure below:

4. Ensure thatFlutterDartThe plug-in is installed successfully. The Mac environment can be searched according to the command lineFlutterDirectory, terminal ->export $PATHView the configuration item directory. It is relatively easy to find the Flutter path directly in the folder, as shown in the figure below:

You can also add Settings to the Flutter SDK path by going to AndroidStudio -> Setting -> Languages & Frameworks -> Flutter. As shown in figure:

6. Proceed to the next step and fill in the company name (package name).Note that it can only be lowercaseSelect support for Kotlin/Swift and finish as shown in the figure below:

7. After that, the project creation page will be entered. The first creation will be a long and lengthy process, as shown in the picture:

8. Connect the mobile phone to the computer and run it, as shown in the picture:


Matters needing attention

Problem 1: The current version of Flutter is not the latest version
Solution: Terminal -> Upgrade Upgrade

Question 2: “…” is not a valid Dart package name.
Solution: The project root folder cannot contain larger letters

New Flutter Project cannot be found…
Solution:
  1. It is recommended to upgrade AndroidStudio to at least 3.0 or above.
  2. Restart AndroidStudio;
  3. Check whether the Flutter configuration environment is normal

Tips: During the Project creation process, if you do not change the default Project location root folder name to the Project name, it cannot be uppercase letters. If you change the Project Location selection path, the last folder name cannot be uppercase.


Learning a technology is really not easy ah, a simple Hello world! There are a lot of things involved, need more attention, only continue to adhere to it is possible to succeed!


Source: Little Monk A Ce