pichillilorenzo / flutter_inappwebview

A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.
https://inappwebview.dev
Apache License 2.0
3.26k stars 1.6k forks source link

Xcode 14 failed to compile due to a swift file annotation #1287

Closed davidAg9 closed 2 weeks ago

davidAg9 commented 2 years ago

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.

github-actions[bot] commented 2 years ago

👋 @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!

combi-35 commented 2 years ago

Can also confirm this issue with iOS 16.0 installed.

thilojaeggi commented 2 years ago

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

ghost commented 2 years ago

Same here.

daironigr commented 2 years ago

Same here, any solution?

bcmehdi8 commented 2 years ago

the issue start appearing after upgrading to Xcode 14

GregoryConrad commented 2 years ago

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

digit81 commented 2 years ago

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

j-ixcayau commented 2 years ago

To me works change 13 to 14 in podfile

platform :ios, '14.0'

jeff-odopass commented 2 years ago

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

daironigr commented 2 years ago

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

github-actions[bot] commented 2 weeks ago

This issue is stale and has been automatically closed because it has been open for more than 365 days with no activity. Please reopen a new issue if you still have it.