flutter_inappwebview icon indicating copy to clipboard operation
flutter_inappwebview copied to clipboard

Xcode 14 failed to compile due to a swift file annotation

Open davidAg9 opened this issue 3 years ago • 10 comments

Environment

Technology Version
Flutter version 3.0.5
Plugin version >= 5.4.2+1
Android version
iOS version 15.5
Xcode version 14

Device information:

Description

Expected behavior: To compile and build my app successfully Current behavior: Build failure

Steps to reproduce

  1. The environment sdk in my pub spec.yaml has a range of environment: sdk: ">=2.7.0 <3.0.0"

errorMessage

Error output from Xcode build: /Users/daveagyakwa/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.4.2+1/ios/Classes/Types/UserScript.swift:13:6: error: stored properties cannot be marked potentially unavailable with '@available' Swift Compiler Error (Xcode): Stored properties cannot be marked potentially unavailable with '@available' Error launching application on Dave’s iPhone.

davidAg9 avatar Aug 18 '22 21:08 davidAg9

👋 @davidAg9

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

github-actions[bot] avatar Aug 18 '22 21:08 github-actions[bot]

Can also confirm this issue with iOS 16.0 installed.

combi-35 avatar Aug 22 '22 17:08 combi-35

Same issue here, compiles fine on CI (Codemagic) though, so this is also related to Xcode 14 I think?

thilojaeggi avatar Aug 28 '22 10:08 thilojaeggi

Same here.

ghost avatar Sep 08 '22 06:09 ghost

Same here, any solution?

daironigr avatar Sep 12 '22 19:09 daironigr

the issue start appearing after upgrading to Xcode 14

bcmehdi8 avatar Sep 12 '22 21:09 bcmehdi8

This is definitely an issue with upgrading to Xcode 14; see here: https://stackoverflow.com/questions/41904724/using-available-with-stored-properties

GregoryConrad avatar Sep 13 '22 02:09 GregoryConrad

PR is waiting to fix this issue: https://github.com/pichillilorenzo/flutter_inappwebview/pull/1238

digit81 avatar Sep 13 '22 05:09 digit81

To me works change 13 to 14 in podfile

platform :ios, '14.0'

j-ixcayau avatar Sep 13 '22 15:09 j-ixcayau

Downgrading xCode from version 14.0 to previous version 13.4.1 also fix the issue, and looks like a better option according to me as some users still use IOS < 14.
Simply downnload whatever version of xCode you want, install it, and then in xCode > Preferences > Locations select the desired version in the bottom dropdown.

Hope it helps

jeff-odopass avatar Sep 13 '22 15:09 jeff-odopass

This solution works for me 👌🏻 👉🏻 https://stackoverflow.com/a/73699790/13821080

Update version in Podfile platform :ios, '14.0' Reset pods cd ios && rm -rf Pods/ Podfile.lock && pod install --repo-update

daironigr avatar Sep 19 '22 08:09 daironigr