Search code examples
iosxcodeflutterdartxcode14

Swift Compiler Error: Stored properties cannot be marked potentially unavailable with '@available'


After upgraded xCode to v14.0.1 from xCode 13, i got this error and can't run my app anymore, i don't have any idea about how to fix this!

is this an issue with xCode 14? Error Message:

Swift Compiler Error (Xcode): Stored properties cannot be marked potentially unavailable with '@available'

Photo: enter image description here I'm developing a Flutter apps, and got this error message in Android Studio, any idea how to fix this please?


Solution

  • Ok .. i fixed this problem by changing the iOS version in file "DKImagePickerController":

    From:

     @available(iOS 13.0, *)
        @objc lazy public var shouldDismissViaUserAction = false
    

    to:

     @available(iOS 11.0, *)
        @objc lazy public var shouldDismissViaUserAction = false
    

    Now my apps working perfectly without any issues, and in Podfile i didn't change anything, still using iOS 12

    platform :ios, '12.0'
    

    Then, run this cmd in terminal:

    pod update && pod install