flutter_statusbarcolor icon indicating copy to clipboard operation
flutter_statusbarcolor copied to clipboard

iOS build error : Property 'windowScene' not found on object of type 'UIWindow *'

Open Skyost opened this issue 5 years ago • 6 comments

Stacktrace :

Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/me/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sta
    tusbarcolor-0.2.2/ios/Classes/FlutterStatusbarcolorPlugin.m:15:37: warning:
    implicit conversion from 'long long' to 'NSInteger' (aka 'int') changes
    value from 38482458385 to -172247279 [-Wconstant-conversion]
    static NSInteger statusBarViewTag = 38482458385;
                     ~~~~~~~~~~~~~~~~   ^~~~~~~~~~~
    /Users/hugo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sta
    tusbarcolor-0.2.2/ios/Classes/FlutterStatusbarcolorPlugin.m:71:105: error:
    property 'windowScene' not found on object of type 'UIWindow *'
               UIView* statusBar = [[UIView alloc]initWithFrame:[UIApplication
               sharedApplication].keyWindow.windowScene.statusBarManager.statusB
               arFrame];
                                                                                                            ^
    1 warning and 1 error generated.

Flutter doctor, if needed :

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.13.6 17G65, locale
    fr-FR)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from:
      https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK
      components.
      (or visit https://flutter.dev/setup/#android-setup for detailed
      instructions).
      If the Android SDK has been installed to a custom location, set
      ANDROID_HOME to that location.
      You may also want to add it to your PATH environment variable.

[✓] Xcode - develop for iOS and macOS (Xcode 10.1)
[!] Android Studio (not installed)
[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

Skyost avatar Sep 24 '19 22:09 Skyost

@onikiri2007 Did you get this compile error?

mchome avatar Sep 26 '19 14:09 mchome

@Skyost , i got the same problem on version 0.2.2.

It works fine on 0.2.1, try using flutter_statusbarcolor: 0.2.1

pedrovilela avatar Sep 26 '19 15:09 pedrovilela

Yes, You need to compile with Xcode 11

onikiri2007 avatar Sep 26 '19 23:09 onikiri2007

windowScene is only available in iOS 13 SDK so if don't compile with Xcode 11 it will have a compile error. if using XCode 10 I would suggest downgrade to 0.2.1

onikiri2007 avatar Sep 26 '19 23:09 onikiri2007

Yes, 0.2.2 only works with XCode 11 , otherwise use 0.2.1 but status bar color won't work on iOS13 devices.

diegoveloper avatar Sep 27 '19 16:09 diegoveloper

Xcode 10 , 0.2.1 is not work too

wylhit1985 avatar Oct 29 '19 09:10 wylhit1985