常見(jiàn)flutter報(bào)錯(cuò)

026

根據(jù)這種報(bào)錯(cuò)能看到子組件和父組件類型不匹配碗淌,

SizedBox 繼承自SingleChildRenderObjectWidget繼承自RenderObjectWidget

而它SizedBox的父組件要求是RenderSliver類型的子集

A RenderViewport expected a child of typeRenderSliverbut received a child of typeRenderConstrainedBox.

父類需要的是RenderSliver 類型的子集但收到了RenderConstrainedBox類型的

The RenderConstrainedBox that did not match the expected child type was created by:SizedBox< Viewport <

IgnorePointer-[GlobalKey#94dc6] Semantics Listener _GestureSemantics <

RawGestureDetector-[LabeledGlobalKey#8bdab] € Listener € _ScrollableScope €


025岗钩、類型不匹配

Positioned widget 用于定位 Stack 的子 widget先朦。

報(bào)這個(gè)錯(cuò)是因?yàn)檠嗌伲琍ositioned放到了Column中檬姥。

Incorrect use of ParentDataWidget.

The ParentDataWidget Positioned(left: 0.0, right: 0.0, bottom: 0.0) wants to apply ParentData of type StackParentData to a RenderObject, which has been set up to accept ParentData of incompatible type FlexParentData.

Usually, this means that the Positioned widget has the wrong ancestor RenderObjectWidget. Typically, Positioned widgets are placed directly inside Stack widgets

The offending Positioned is currently placed inside a Column widget.

024

flutter: error==== {"error":{"message":"Required request body is missing: public void com.wd.paas.controller.ApiV4ModuleController.chatCompletion(java.lang.String,com.wd.paas.domain.v4.chat.ChatCompletionRequest,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)","code":"400"}}

flutter: pustChatGPT==== null


022俏拱、

│ Following this change, your app will not be available to users running Android SDKs below 21. │

│ Consider searching for a version of this plugin that supports these lower versions of the? ? │

這是安卓最低支持版本問(wèn)題埃篓,到安卓基礎(chǔ)信息配置文件中,更改一下安卓最低支持版本即可疆股,

位置在Android/app/build.gradle中费坊,修改他的值minSdkVersion

021

Unhandled Exception: MissingPluginException(No implementation found for method isInstalled on channel v7lin.github.io/alipay_kit)

Unhandled Exception: MissingPluginException(No implementation found for method isInstalled on channel v7lin.github.io/alipay_kit)

020

接收J(rèn)SON數(shù)據(jù)解析問(wèn)題,double對(duì)應(yīng)浮點(diǎn)類型押桃,int對(duì)應(yīng)整數(shù)葵萎,

但網(wǎng)址JSON轉(zhuǎn)model导犹,會(huì)將12.0自動(dòng)轉(zhuǎn)成整數(shù)類型,需要我們手動(dòng)更改一下

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'int' is not a subtype of type 'double?'

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'double' is not a subtype of type 'int?'

019

Vertical viewport was given unbounded height.

018

BoxConstraints forces an infinite width.

在row中添加過(guò)寬的部件羡忘,需要包一個(gè)Expanded

017

Unable to load asset: "assets/image/my/my_vip_icon.png".

需要到pubspec中配置圖片路徑


011

401報(bào)錯(cuò)

Client error - the request contains bad syntax or cannot be fulfilled"

請(qǐng)求頭配置有問(wèn)題谎痢,

010 Dio解析錯(cuò)誤

Reloaded 1 of 1452 libraries in 466ms (compile: 108 ms, reload: 168 ms, reassemble: 152 ms).

[?? Dio] The data is a type of Map (_Map), but the transformer can only encode Map.

If you are writing maps using {}, consider writing{}.

009

Typically, this is done by calling "WidgetsFlutterBinding.ensureInitialized()" or "runApp()" (the latter calls the former). Typically this call is done in the "void main()" method. The "ensureInitialized" method is idempotent; calling it multiple times is not harmful. After calling that method, the "instance" getter will return the binding.

調(diào)用第三方或者使用了底層數(shù)據(jù),需要在調(diào)用之前初始化

WidgetsFlutterBinding.ensureInitialized()

008.

Vertical viewport was given unbounded height.

垂直視口被賦予了無(wú)限高度卷雕。

007

Vertical viewport was given unbounded height.

不可滾動(dòng)的部件內(nèi)容過(guò)高或過(guò)寬導(dǎo)致的节猿,

如在Column中使用GridView。

GridView.builder沒(méi)有設(shè)置滾動(dòng)漫雕,就會(huì)導(dǎo)致這種情況

將其shrinkWrap屬性設(shè)置為可滾動(dòng)即可

shrinkWrap: true,

或者使用Expanded將GridView包裹起來(lái)滨嘱。

006

A RenderFlex overflowed by 392 pixels on the bottom.

說(shuō)明內(nèi)容超出了屏幕高度或?qū)挾龋@是因?yàn)樗貌考皇菨L動(dòng)的浸间,請(qǐng)改用滾動(dòng)部件太雨,

或者使用Expanded包裹起來(lái)。

005魁蒜、

"RecommendLogic" not found. You need to call "Get.put(RecommendLogic())" or "Get.lazyPut(()=>RecommendLogic())"

需要再M(fèi)ainBinding 中將RecommendLogic做捆綁

004囊扳、

Cannot find declaration to go to

003、

部分插件在適配空安全的版本放棄維護(hù)了兜看,得自行更新或?qū)ふ姨娲断蹋纾?flutter_swiper 變?yōu)?flutter_swiper_null_safety ,插件更新后要注意項(xiàng)目中的用法是否需要更新

002

Error (Xcode): Build input file cannot be found: '/Users/tyu/.pub-cache/hosted/pub.flutter-io.cn/video_player_avfoundation-2.5.1/darwin/Classes/messages.g.m'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?

刪掉這個(gè)兩個(gè)文件细移,然后重新運(yùn)行搏予,

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市弧轧,隨后出現(xiàn)的幾起案子雪侥,更是在濱河造成了極大的恐慌,老刑警劉巖精绎,帶你破解...
    沈念sama閱讀 217,185評(píng)論 6 503
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件校镐,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡捺典,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,652評(píng)論 3 393
  • 文/潘曉璐 我一進(jìn)店門从祝,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)襟己,“玉大人,你說(shuō)我怎么就攤上這事牍陌∏嬖。” “怎么了?”我有些...
    開(kāi)封第一講書人閱讀 163,524評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵毒涧,是天一觀的道長(zhǎng)贮预。 經(jīng)常有香客問(wèn)我,道長(zhǎng),這世上最難降的妖魔是什么仿吞? 我笑而不...
    開(kāi)封第一講書人閱讀 58,339評(píng)論 1 293
  • 正文 為了忘掉前任滑频,我火速辦了婚禮,結(jié)果婚禮上唤冈,老公的妹妹穿的比我還像新娘峡迷。我一直安慰自己,他們只是感情好你虹,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,387評(píng)論 6 391
  • 文/花漫 我一把揭開(kāi)白布绘搞。 她就那樣靜靜地躺著,像睡著了一般傅物。 火紅的嫁衣襯著肌膚如雪夯辖。 梳的紋絲不亂的頭發(fā)上,一...
    開(kāi)封第一講書人閱讀 51,287評(píng)論 1 301
  • 那天董饰,我揣著相機(jī)與錄音蒿褂,去河邊找鬼。 笑死尖阔,一個(gè)胖子當(dāng)著我的面吹牛贮缅,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播介却,決...
    沈念sama閱讀 40,130評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼谴供,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了齿坷?” 一聲冷哼從身側(cè)響起桂肌,我...
    開(kāi)封第一講書人閱讀 38,985評(píng)論 0 275
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎永淌,沒(méi)想到半個(gè)月后崎场,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,420評(píng)論 1 313
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡遂蛀,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,617評(píng)論 3 334
  • 正文 我和宋清朗相戀三年谭跨,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片李滴。...
    茶點(diǎn)故事閱讀 39,779評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡螃宙,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出所坯,到底是詐尸還是另有隱情谆扎,我是刑警寧澤,帶...
    沈念sama閱讀 35,477評(píng)論 5 345
  • 正文 年R本政府宣布芹助,位于F島的核電站堂湖,受9級(jí)特大地震影響闲先,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜无蜂,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,088評(píng)論 3 328
  • 文/蒙蒙 一伺糠、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧酱讶,春花似錦退盯、人聲如沸。這莊子的主人今日做“春日...
    開(kāi)封第一講書人閱讀 31,716評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至灶挟,卻和暖如春琉朽,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背稚铣。 一陣腳步聲響...
    開(kāi)封第一講書人閱讀 32,857評(píng)論 1 269
  • 我被黑心中介騙來(lái)泰國(guó)打工箱叁, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人惕医。 一個(gè)月前我還...
    沈念sama閱讀 47,876評(píng)論 2 370
  • 正文 我出身青樓耕漱,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親抬伺。 傳聞我的和親對(duì)象是個(gè)殘疾皇子螟够,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,700評(píng)論 2 354

推薦閱讀更多精彩內(nèi)容