1:classpath错误
在项目目录下的android/build.gradle文件中增加如下代码:
// maven {
// url 'https://dl.google.com/dl/android/maven2'
// }
2:图标展示异常
pubspec.yaml文件下增加如下配置: uses-material-design: true
3:Text组件异常
4:MediaQuery.of() called with a context that does not contain a MediaQuery.
用MaterialApp包裹一层
5:TextField widgets require a Material widget ancestor.
用Scaffold包裹一层
6: TextFormField的autofoocus的bug
Failed assertion: line 1687 pos 12: 'hasSize'
可以理解为当前页面还未绘制完的时候,我们就使用 TextField 来获取输入焦点了
可以删掉autofoocus
7.连接安卓真机的时候显示安装失败
Error: ADB exited with exit code 1
Performing Streamed Install
adb: failed to install /Users/bj-51-60-1220/Desktop/new/hello_world/build/app/outputs/apk/app.apk: Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user]
Error launching application on ***.
解决方式:需要允许安卓手机的usb安装app功能