bytedance / flutter_ume

UME is an in-app debug kits platform for Flutter. Produced by Flutter Infra team of ByteDance
MIT License
2.07k stars 224 forks source link

app切后台再切回时ume插件报空指针异常导致app崩溃 #128

Open linruoxi688 opened 1 year ago

linruoxi688 commented 1 year ago

Steps to Reproduce 复现步骤

  1. ...
  2. ...
  3. ...

Expected results 期望结果:

Actual results 实际结果:

Error log 错误日志

Null check operator used on a null value
#0      _SelectionInfo.message (package:flutter_ume/service/inspector/inspector_overlay.dart:283)
#1      _InspectorOverlayLayer._buildPicture (package:flutter_ume/service/inspector/inspector_overlay.dart:168)
#2      _InspectorOverlayLayer.addToScene (package:flutter_ume/service/inspector/inspector_overlay.dart:125)
#3      Layer._addToSceneWithRetainedRendering (package:flutter/src/rendering/layer.dart:671)
#4      ContainerLayer.addChildrenToScene (package:flutter/src/rendering/layer.dart:1281)
#5      TransformLayer.addToScene (package:flutter/src/rendering/layer.dart:1913)
#6      ContainerLayer.buildScene (package:flutter/src/rendering/layer.dart:1094)
#7      RenderView.compositeFrame (package:flutter/src/rendering/view.dart:236)
#8      RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:520)
#9      WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:865)
#10     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:381)
#11     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1289)
#12     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1218)
#13     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1076)
#14     _rootRun (dart:async/zone.dart:1398)
#15     _CustomZone.run (dart:async/zone.dart:1300)
#16     _CustomZone.runGuarded (dart:async/zone.dart:1208)
#17     _invoke (dart:ui/hooks.dart:147)
#18     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:338)
#19     _drawFrame (dart:ui/hooks.dart:112)

Environmental info 环境信息

Flutter doctor

[✓] Flutter (Channel stable, 3.7.0, on macOS 13.4 22F66 darwin-arm64, locale
    zh-Hans-CN)
    • Flutter version 3.7.0 on channel stable at /Users/anker/Develop/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b06b8b2710 (7 个月前), 2023-01-23 16:55:55 -0800
    • Engine revision b24591ed32
    • Dart version 2.19.0
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/anker/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at:
      /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin/java
    • Java version Java(TM) SE Runtime Environment 18.9 (build
      11.0.19+9-LTS-224)
    • All Android licenses accepted.

[✗] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS
      development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin
        code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install see
      https://guides.cocoapods.org/using/getting-started.html#installation for
      instructions.

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] VS Code (version 1.81.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
    • 2211133C (mobile) • 38806799 • android-arm64  • Android 13 (API 33)
    • macOS (desktop)   • macos    • darwin-arm64   • macOS 13.4 22F66
      darwin-arm64
    • Chrome (web)      • chrome   • web-javascript • Google Chrome
      116.0.5845.96

[✓] HTTP Host Availability
    • All required HTTP hosts are available

UME and kits version UME 及插件包版本

  # 调试工具
  flutter_ume: ^1.1.1
  flutter_ume_kit_ui: ^1.1.0
  # flutter_ume_kit_device: ^1.0.0
  # flutter_ume_kit_perf: ^1.0.0
  # flutter_ume_kit_show_code: ^1.0.0+1
  flutter_ume_kit_console: ^1.0.0
  flutter_ume_kit_dio: ^1.0.1+2