当前位置:网站首页>Set up the flutter environment pit collection
Set up the flutter environment pit collection
2022-07-06 17:03:00 【Society, you Lei brother, life is hard, don't bend down】
build flutter Environment used 4 One afternoon , It can be said that life has reached a climax . hear tell mac It's better to match the environment , But I use windows, alas , Basically, all the pits we should encounter have been walked once . I won't talk about building an environment , You can watch the video of technology fat in b On the site , Just talk about the pit you encountered , Come to the text .
Question 1 : Yes get packages Third party package problem . Without this, the code will directly report errors in the compiler environment , There are two ways to get , The first is to climb over the wall , The requirements for ladders in this way are still a little high , Not recommended . The second is flutter Special care for domestic users , Setting the image source can solve the problem .
FLUTTER_STORAGE_BASE_URL = https://storage.flutter-io.cn
PUB_HOSTED_URL = https://pub.flutter-io.cn

It is strongly recommended to turn off the computer here , Reopen when encountering flutter create project The project fails or the compiler get packages When the third party reports an error .
Question two Plugin with id 'kotlin-android' not found I have solved this mistake for a long time , I got the answer after others helped me solve the problem . This is because there is no correct introduction kotlin-android Errors caused by plug-ins
First step : In the project android\app Under the table of contents build.gradle File insert , See clearly that it is in app This file in the directory
apply plugin: 'kotlin-android'
This code 
The effect picture is shown above
The second step Project androd There is also a build.gradle file , Open and add the following two pieces of code in a fixed position
ext.kotlin_version = '1.3.50'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

Notice that the first piece of code is outside that object , I put it in the wrong position during debugging , Led to more holes . This problem has been solved without accident .
Question 3 : Others may report this error , I don't seem to have encountered this problem , Before debugging, I changed it according to the blog of techno fat , This is also because of the wall .
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
ProcessException: Process "/Users/rabbit/develop/android/flutter_app/android/gradlew" exited abnormally:
Project evaluation failed including an error in afterEvaluate {
}. Run with --stacktrace for details of the afterEvaluate {
} error.
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/rabbit/develop/android/flutter_app/android/app/build.gradle' line: 25
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all files for configuration 'classpath'.
> Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
Command: /Users/rabbit/develop/android/flutter_app/android/gradlew app:properties
Finished with error: Please review your Gradle project setup in the android/ folder.
For this error, you can refer to the blog of technology fat https://jspang.com/detailed?id=41#toc222, Note that two files need to be changed .
Question 4 : Finally, we need to pay attention gradle There should be a corresponding relationship between the version and its plug-ins , Here is a table 


The plug-in version here is 3.5.0,gradle The version is 5.6.2. In accordance with the regulations . The directory of the second file is the project \android\gradle\wrapper, Just check that file , If it does not conform to the above table, it will be changed .
边栏推荐
- 面试集锦库
- (multiple methods, need to continue to see) 7-11 go deep into the tiger's Den
- 唯有学C不负众望 TOP2 p1变量
- Usage of insert() in vector
- MySQL日期函数
- ByteDance 2022 school recruitment R & D advance approval publicity meeting, students' top 10 issues
- Assembly language segment definition
- ~71 abbreviation attribute of font
- ~72 horizontal and vertical alignment of text
- Yum install XXX reports an error
猜你喜欢

The QT program compiled on CentOS lacks a MySQL driven solution

Activit fragmented deadly pit

Erlang installation

~87 animation

我走过最迷的路,是字节跳动程序员的脑回路

~84 form supplement

Yao BanZhi and his team came together, and the competition experts gathered together. What fairy programming competition is this?

Koa Middleware

IDEA断点调试技巧,多张动图包教包会。

Solr standalone installation
随机推荐
Many papers on ByteDance have been selected into CVPR 2021, and the selected dry goods are here
Ce n'est qu'en apprenant que c est à la hauteur des attentes Top5 s1e8 | s1e9: caractères et chaînes & opérateurs arithmétiques
Restful style interface design
唯有学C不负众望 TOP2 p1变量
~81 long table
ByteDance technical Interviewer: what kind of candidate do I want to pick most
Shell_ 05_ operator
Log4j2 major vulnerabilities and Solutions
Train 100 pictures for 1 hour, and the style of the photos changes at will. There is a demo at the end of the article | siggraph 2021
How to configure hosts when setting up Eureka
Activiti目录(三)部署流程、发起流程
ByteDance 2022 school recruitment R & D advance approval publicity meeting, students' top 10 issues
在 vi 编辑器中的命令模式下,删除当前光标处的字符使用 __ 命 令。
The 116 students spent three days reproducing the ByteDance internal real technology project
DS18B20数字温度计系统设计
The daemon thread starts redis and modifies the configuration file
~74 JD top navigation bar exercise
姚班智班齐上阵,竞赛高手聚一堂,这是什么神仙编程大赛?
yum install xxx报错
Activiti目录(一)重点介绍