对flutter有兴趣的小伙伴可以一起学习呀~
好用的命令行
flutter pub pub cache repair :清理缓存
错误一:
- flutter project插入图片异常
xjdMacBook-Pro:flutter_app_layout xj.d$ flutter run -d all
Running "flutter packages get" in flutter_app_layout...
Error on line 40, column 2 of pubspec.yaml: Expected a key while parsing a block mapping.
assets:
^
pub get failed (65)
flutter插入图片
1.根项目创建文件名为【图像】文件夹
2.将文件复制到文件夹下面
3.pubspec.yaml文件下面配置该图片
注意图的名字都正确,配置和使用都保持一致(楼主该图随便百度下的),否则无法找到资源
错误二:
- 错误提示:请在android / folde中查看您的Gradle项目设置
+818 ms]
------------------------------------------------------------
Gradle 4.1
------------------------------------------------------------
Build time: 2017-08-07 14:38:48 UTC
Revision: 941559e020f6c357ebb08d5c67acdb858a3defc2
Groovy: 2.4.11
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_152-release (JetBrains s.r.o 25.152-b06)
OS: Mac OS X 10.14.1 x86_64
[{"event":"app.progress","params":{"appId":"d7911b72-32cb-4f2c-b548-e7b8e073da36","id":"0","progressId":null,"finished":true}}]
Resolving dependencies...
[{"event":"app.progress","params":{"appId":"d7911b72-32cb-4f2c-b548-e7b8e073da36","id":"1","progressId":null,"message":"Resolving dependencies..."}}]
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/xj.deng/Ali/widgets/hybrid_stack_manager/example/android/app/build.gradle' line: 15
* 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.
.....
* Error running Gradle:
Exit code 1 from: /Users/xj.deng/