美文网首页
Flutter日常填坑指南

Flutter日常填坑指南

作者: C_HPY | 来源:发表于2019-04-26 15:24 被阅读0次

1、打开了iOS的模拟器,但是在android studio里面死活发现不了模拟器,在终端中执行:

➜  ~ flutter config --android-sdk /Users/wuhaiwei/Library/Android
Setting "android-sdk" value to "/Users/wuhaiwei/Library/Android".

2、执行flutter命令报错:

Waiting for another flutter command to release the startup lock...

在终端中执行:

➜  ~ rm Desktop/FlutterSDK/bin/cache/lockfile

see here
3、assert在条件不满足的时候不会断言

assert(jsonList[i] is String);

上述条件 jsonList[i] 是Map类型,然而在热重载开发中不会断点,幸运的是在Xcode中有错误提示:

2019-05-06 09:44:02.784480+0800 qding[95703:1028454] flutter: Another exception was thrown: 'package:qding_flutter/page/mine_info.dart': Failed assertion: line 86 pos 14: 'jsonList[i] is String': is not true.

4、app从后台进入前台,再进入Flutter模块儿直接闪退,偶现

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xb0)
    frame #0: 0x00000001c3464b94 AppleMetalGLRenderer`GLRResourceList::addFence(GLRResource*) + 20
    frame #1: 0x00000001c3475378 AppleMetalGLRenderer`GLDContextRec::flushContextInternal() + 120
    frame #2: 0x00000001c4381d60 GLEngine`gliBindViewES + 108
    frame #3: 0x00000001a62959ac OpenGLES`-[EAGLContext renderbufferStorage:fromDrawable:] + 500
    frame #4: 0x0000000109f3d88c libglInterpose.dylib`EAGLContext_renderbufferStorageFromDrawable(EAGLContext*, objc_selector*, unsigned long, id<EAGLDrawable>) + 1044
    frame #5: 0x000000010af271f8 Flutter`___lldb_unnamed_symbol831$$Flutter + 180
    frame #6: 0x000000010af273ac Flutter`___lldb_unnamed_symbol838$$Flutter + 40
    frame #7: 0x000000010b27a868 Flutter`___lldb_unnamed_symbol13085$$Flutter + 132
    frame #8: 0x000000010af27374 Flutter`___lldb_unnamed_symbol837$$Flutter + 44
    frame #9: 0x000000010af1ca5c Flutter`___lldb_unnamed_symbol535$$Flutter + 344
    frame #10: 0x000000010af1cbb0 Flutter`___lldb_unnamed_symbol536$$Flutter + 188
  * frame #11: 0x0000000104d8736c qding`-[QDPushFlutterBaseVC viewWillAppear:](self=0x0000000154a24e00, _cmd="viewWillAppear:", animated=YES) at QDPushFlutterBaseVC.m:95:5
    frame #12: 0x00000001cf064014 UIKitCore`-[UIViewController _setViewAppearState:isAnimating:] + 584
    frame #13: 0x00000001cf0646e0 UIKitCore`-[UIViewController __viewWillAppear:] + 140
    frame #14: 0x00000001cefbbea8 UIKitCore`-[UINavigationController _startCustomTransition:] + 1248
    frame #15: 0x00000001cefcfde8 UIKitCore`-[UINavigationController _startDeferredTransitionIfNeeded:] + 708
    frame #16: 0x00000001cefd1210 UIKitCore`-[UINavigationController __viewWillLayoutSubviews] + 164
    frame #17: 0x00000001cefb4420 UIKitCore`-[UILayoutContainerView layoutSubviews] + 224
    frame #18: 0x00000001cfa8fe54 UIKitCore`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1292
    frame #19: 0x00000001a751e1f0 QuartzCore`-[CALayer layoutSublayers] + 184
    frame #20: 0x00000001a7523198 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 332
    frame #21: 0x00000001a74860a8 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 348
    frame #22: 0x00000001a74b4108 QuartzCore`CA::Transaction::commit() + 640
    frame #23: 0x00000001a74b4cf8 QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
    frame #24: 0x00000001a302189c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
    frame #25: 0x00000001a301c5c4 CoreFoundation`__CFRunLoopDoObservers + 412
    frame #26: 0x00000001a301cb40 CoreFoundation`__CFRunLoopRun + 1228
    frame #27: 0x00000001a301c354 CoreFoundation`CFRunLoopRunSpecific + 436
    frame #28: 0x00000001a521c79c GraphicsServices`GSEventRunModal + 104
    frame #29: 0x00000001cf607b68 UIKitCore`UIApplicationMain + 212
    frame #30: 0x0000000104ea2dec qding`main(argc=1, argv=0x000000016b2eb800) at main.m:14:16
    frame #31: 0x00000001a2ae28e0 libdyld.dylib`start + 4

这里有一个类似的问题,我正在想办法解决

相关文章

网友评论

      本文标题:Flutter日常填坑指南

      本文链接:https://www.haomeiwen.com/subject/bsxqnqtx.html