Skip to content

SystemChrome.setSystemUIOverlayStyle crashed on iOS #20215

@llearn

Description

@llearn

Steps to Reproduce

SystemChrome.setSystemUIOverlayStyle crashed on iOS , Android is OK.

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
      statusBarColor: Colors.red,
    ));
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: new AppBar(
          title: new Text('Flutter Demo Home Page'),
        ),
        body: new Container(),
      ),
    );
  }
}

wx20180804-143911 2x

Logs

Launching lib/main.dart on iPhone X in debug mode...
Starting Xcode build...
Xcode build done.
Syncing files to device iPhone X...
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001039711e6 __exceptionPreprocess + 294
	1   libobjc.A.dylib                     0x0000000103006031 objc_exception_throw + 48
	2   CoreFoundation                      0x00000001039f2784 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x00000001038f3898 ___forwarding___ + 1432
	4   CoreFoundation                      0x00000001038f3278 _CF_forwarding_prep_0 + 120
	5   Flutter                             0x00000001012aa7a2 -[FlutterPlatformPlugin setSystemChromeSystemUIOverlayStyle:] + 90
	6   Flutter                             0x00000001012aa209 -[FlutterPlatformPlugin handleMethodCall:result:] + 297
	7   Flutter                             0x00000001012a41a4 __45-[FlutterMethodChannel setMethodCallHandler:]_block_i<…>
Lost connection to device.

Analyzing flutter_app...
No issues found! (ran in 1.4s)
[✓] Flutter (Channel master, v0.5.8-pre.229, on Mac OS X 10.13.6 17G65, locale zh-Hans-CN)
    • Flutter version 0.5.8-pre.229 at /usr/local/flutter
    • Framework revision cacd291c5c (17 hours ago), 2018-08-03 15:13:28 +0200
    • Engine revision 4893b0760d
    • Dart version 2.0.0-dev.69.5.flutter-8bad5c7b29

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.1)
    • Android SDK at /data/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.1
    • ANDROID_HOME = /data/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.4.1, Build version 9F2000
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 26.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] VS Code (version 1.25.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.16.0

[✓] Connected devices (2 available)
    • Android SDK built for x86 • emulator-5554                        • android-x86 • Android 9 (API 28) (emulator)
    • iPhone X                  • 98C59433-C15B-4AE8-8721-8361FE90B8D8 • ios         • iOS 11.4 (simulator)

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashStack traces logged to the consoleengineflutter/engine related. See also e: labels.platform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions