1.添加依赖出现错误(eg:english_words)

按照官网的方法添加完依赖是没有问题的, 把
import 'package:english_words/english_words.dart';
导入到main.dart 中,开始import后面全部报红,百度了多方法都没用,下面是错误
Error on line 6, column 5 of pubspec.yaml: A dependency may only have one
source. sdk: flutter ^^^^^^^^^^^^^^ pub get failed (60)
解决办法:  注意添加依赖时sdk的格式(对齐方式  -_-||)



正常了。



2.Failed to install the following Android SDK packages as some licences have
not been accepted.



打开我 的build.gradle文件里面android { }的内容没有  (下图框住内容刚加的)



2.Could not find method android() for arguments
[[email protected]] on object of
type org.gradle.api.internal.initialization.DefaultScriptHandler.