flutter bug汇总

1:卡启动页的另外一个情况就是版本运行出错,用xcode运行真机会报错,卡启动页

具体情况如下

Runner[39545:15296040] [VERBOSE-2:dart_vm.cc(259)] VM snapshot must be valid.
Runner[39545:15296040] [VERBOSE-3:shell.cc(212)] Check failed: vm. Must be able to initialize the VM.
image.png

解决办法是https://github.com/flutter/flutter/issues/24641

image.png

修改Edit Scheme...为release

2:在pubspec.yaml中添加库文件导致的错误

D8: Program type already present: android.support.v4.os.ResultReceiver$MyResultReceiver

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/0.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/1.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/2.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/3.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/8.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/9.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/10.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/11.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/12.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/13.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/14.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/15.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/16.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/17.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/18.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/19.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/20.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/21.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/22.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/23.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/24.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/25.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/26.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/27.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/28.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/29.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/30.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/31.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/32.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/33.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/34.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/35.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/36.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/37.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/38.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/39.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/40.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/41.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/42.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/43.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/44.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/45.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/46.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/47.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/48.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/49.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/50.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/51.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/52.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/53.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/54.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/55.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/56.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/57.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/58.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/59.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/60.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/61.jar, /Users/csxsky/AndroidStudioProjects/flutter_employees_pms/build/app/intermediates/transforms/dexBuilder/debug/62.jar
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
  Program type already present: android.support.v4.os.ResultReceiver$MyResultReceiver

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.
*******************************************************************************************
Finished with error: Gradle task assembleDebug failed with exit code 1

解决办法就是在这个文件里面添加如下代码


image.png
# 需要在gradle.properties中添加下面两行代码
# 这是因为混合支持库。通过添加这些行选择androidX作为您的支持库
android.useAndroidX=true
android.enableJetifier=true

3:个别页面出现无法进行debug断点调试,打了断点却无作用

///page
import 'package:flutter_employees_pms/Page/DashBoard//DashBoardPage.dart';

改成

///page
import 'package:flutter_employees_pms/Page/DashBoard/DashBoardPage.dart';

就因为这个页面在引用的时候多加了一个/

4:'multi_image_picker/multi_image_picker-Swift.h' file not found

Android没问题,但xcode中编译会报错,找了一圈


image.png

在这里填上这句话就好了,暂且不知道原理,应该是swift和OC混编问题

5:The iOS Simulator deployment target is set to x.x, but the range of supported deployment target versions for this platform is 8.0 to 12.0. (in target 'xxx')

post_install do |installer|
  installer.pods_project.targets.each do |target|
 target.build_configurations.each do |config|
  if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 8.0
把Podfile里底下的代码替换成下面的
    ![image.png](https://upload-images.jianshu.io/upload_images/1956903-0185cde7be4c2838.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
     end
   end
  end
end

6:warning: Could not find auto-linked framework 'Flutter'

修改xcode的Podfile


image.png
config.build_settings['ENABLE_BITCODE'] = 'NO'

注意放在target.build_configurations.each do |config|之下

7:Device doesn't support wireless sync. AMDeviceStartService(device, CFSTR("com.apple.debugserver"), &gdbfd, NULL)

flutter channel dev
/// 或下面
flutter channel master

老版本的bug,升级flutter就好了,但问题就是升级后会有很多改动休要手动修复

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 204,684评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 87,143评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 151,214评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,788评论 1 277
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,796评论 5 368
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,665评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,027评论 3 399
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,679评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 41,346评论 1 299
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,664评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,766评论 1 331
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,412评论 4 321
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,015评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,974评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,203评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,073评论 2 350
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,501评论 2 343

推荐阅读更多精彩内容