在Row内部不能使用TextField、TextFormField
更新时间2021年08月31日
在row中如果使用 TextField 或者 TextFormField布局会不正确。
解决办法是: 用Expanded 包裹 TextField。
如
child: TextFormField(...)
改为
Expanded(
child : TextFormField(...)
)
flutter 更换开发者账号
更新时间 2021年08月18日
之前跑真机的时候设置过开发这账号, 现在需要更换。
在命令行中执行:
$ flutter config --clear-ios-signing-cert
$ flutter run
然后就可以重新选择证书了
Specs satisfying the flutter_sound (from
.symlinks/plugins/flutter_sound/ios)
dependency were found, but they required a higher minimum deployment target.
更新时间 2021年08月17日
项目使用到了 flutter-sound
更新时报错
[!] CocoaPods could not find compatible versions for pod "flutter_sound":
In Podfile:
flutter_sound (from `.symlinks/plugins/flutter_sound/ios`)
Specs satisfying the `flutter_sound (from `.symlinks/plugins/flutter_sound/ios`)` dependency were found, but they required a higher minimum deployment target.
解决办法
找到 .ios 文件夹下的 Podfile文件, 修改第一行代码
platform :ios, '9.0'
修改为:
platform :ios, '10.0'
真机运行报错 You saved my day buddy! thank you!
更新时间 : 2021年08月09日
使用VSCode + Flutter + XCode + iOS 14.6 运行真机。一直卡在
Running Xcode build...
└─Compiling, linking and signing... 6.5s
Xcode build done. 39.0s
Installing and launching... 60.2s
Error launching application on you的iPhone.
解决办法
1 去ios-deploy下载最新的版本。
2 在本地用xoce build一下。然后找到products文件夹下的ios-deploy。 show in finder . 用这个文件替换
找到你flutter的安装目录下的:
flutter/bin/cache/artifacts/ios-deploy/ios-deploy
再次run 就可以了。
参考:
https://juejin.cn/post/6888941460424753166
报错2 Not found: ‘dart:html’
lib/main.dart:1:8: Error: Not found: 'dart:html'
import 'dart:html';
报错原因, 在main.dart 中,偶尔系统会自动给引入一下 dart.html.
// import 'dart:html'; 删除或者注释掉就可以了
import 'package:flutter/material.dart';
解决办法 检查main.dart ,删除掉就可以了
报错1 flutter_test from sdk depends on meta 1.3.0 and json_annotation >=4.1.0 depends on meta ^1.4.0,
Because every version of flutter_test from sdk depends on meta 1.3.0
and json_annotation >=4.1.0 depends on meta ^1.4.0,
flutter_test from sdk is incompatible with json_annotation >=4.1.0.
报错原因 flutter_test依赖meta 1.3.0 , json_annotation >=4.1.0 依赖meta ^1.4.0,
解决:
把
json_annotation >=4.1.0
改为:
json_annotation >=4.0.1
其实不仅仅是 json_annotation 会有冲突, json_serializable也有冲突
json_serializable: ^5.0.0
改成:
json_serializable: ^4.1.3
就好了
参考文章 :
https://minpro.net/conflicts-between-the-latest-versions-of-json_serializable-and-json_annotation