I get this error when I run my app on Xcode 14 beta and I don’t know how to fix it:
Stored properties cannot be marked potentially unavailable with ‘@available’
It doesn’t pop up when I run Xcode 13, and the app runs smoothly. I am in the .xcworkspace file.
7
Answers
I have this error in Flutter project in XCode 14. One of the external packages were using:
@available(iOS 14.0, *)
My current fix is:
Update version in Podfile platform :ios, ‘14.0’,
pod update &&
Pod install
Be sure to change both sections of the iOS Deployment Target in the Build Settings tab, like in my picture:
I had the same problem. As directed by the repository on GitHub, a workaround is to update the Podfile version:
platform :ios, '14.0'
In Xcode 13, and lower, you were able to compile if you used a lazy @available stored property as such:
However, this does not work in Xcode 14.
Instead, you need to use a non-available stored property, and use a computed @available property:
Answer source
In my case the problem was in
flutter_inappwebview
package. I’ve fixed it by using the newest version – 5.4.4+3https://pub.dev/packages/flutter_inappwebview/install
Let me tell you 100% working solution if this error is being raised due to
DKImagePickerController
.Follow these steps:
2.1)
flutter clean
2.2)
flutter pub get
3.1)
pod install
(usearch -x86_64 pod install
if you are using M1)3.2)
pod update
(usearch -x86_64 pod update
if you are using M1)Brother, I just find a solution for my project, It may comes to you workaround, but I still would like to share my experience about it;
Xcode offers us entire class to make @available
This is my workaround solution. You can use the @available attribute on its getter and setter methods instead of the property itself.
This is from my real project;