1、Building flutter tool...問題
2、flutter pub get卡死
網(wǎng)絡(luò)問題導(dǎo)致:
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
3、Waiting for another flutter command to release the startup lock...
等待另一個flutter命令釋放啟動鎖,如果想終止上一個命令鎖:
sudo kill $(ps aux | grep flutter | grep -v grep | awk '{print $2}')
4、Finished with error: Failed to establish connection with the application instance in Chrome.
This can happen if the websocket connection used by the web tooling is unable to correctly establish a connection, for example due to a firewall.
解決:127.0.0.1 localhost

image.png
5、Exception: Invalid image data
圖片數(shù)據(jù)無效,檢查url是否是有效的jpg下載地址
Image.network(
imgList[index]["url"],
fit: BoxFit.fill,
);
6、Bad state: Insecure HTTP is not allowed by platform:http://
IOS 和 Android 9.0 對網(wǎng)絡(luò)請求做了一些限制,不能直接訪問 Http 域名的地址
- android解決
<application
android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true"http://加這一行
android:networkSecurityConfig="@xml/network_security"
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
</network-security-config>

network_secturity
- IOS解決
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>

info.plist
7、Automatically assigning platform iOS with version 9.0 on target Runner
ios/Podfile文件增加平臺配置
platform :ios, '9.0'

image.png