环境缺失依赖
有时候这三个命令有奇效
flutter cleanflutter pub cache repairpub upgrade
提示版本问题,下载项目是 V1 运行环境是V2 参考官方文档更改配置文件
android/app/src/main/AndroidManifest.xml
<applicationandroid:name="io.flutter.app.FlutterApplication"><!-- code omitted --></application>//将 name 后 参数值改为如下<applicationandroid:name="${applicationName}"><!-- code omitted -->//在原来 <meta-data <!-- code omitted --> /> 后添加如下 xml<meta-dataandroid:name="flutterEmbedding"android:value="2" />
下载依赖出错 Android resource linking failed
更改 android/gradle/wrapper/gradle-wrapper.properties 中 distributionUrl 为本地的 gradle 又出现以下
A problem occurred evaluating root project ‘android’
sqllite
The method join isn’t defined for the class uploadIntoDb
import 'package:path/path.dart';
安卓 Sqllite 相对地址 /data/user/0/com.example.todo_list/databases
组件使用有误
flutter Vertical viewport was given unbounded height
这个问题主要是ListView.builder出现的问题,如果是简单用的话,会出现这个问题的话,这时候,我们只需要在ListView.builder加入shrinkWrap: true,,如下图:
