Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 14 build error: Stored properties cannot be marked potentially unavailable with '@available' #1216

Closed
4 tasks done
SethuSenthil opened this issue Jun 8, 2022 · 18 comments
Labels
bug Something isn't working

Comments

@SethuSenthil
Copy link

SethuSenthil commented Jun 8, 2022

Environment

Technology Version
Flutter version 3.0.1
Plugin version 5.4.3+7
Android version n/a
iOS version 16.0 DB1
Xcode version 14 B1

Device information:

Description

When attempting to compile with the new Xcode beta, the following error prevents us from completin.g the build

Expected behavior:
No error

Current behavior:
Throws build error: Stored properties cannot be marked potentially unavailable with '@available'

Steps to reproduce

  1. Run flutter run on any project that depends on flutter_inappwebview

Images

Screen Shot 2022-06-08 at 4 01 13 PM

@SethuSenthil SethuSenthil added the bug Something isn't working label Jun 8, 2022
@github-actions
Copy link

github-actions bot commented Jun 8, 2022

👋 @SethuSenthil

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!

@SethuSenthil
Copy link
Author

After doing some experimentation, I believe the most straightforward approach would be to wrap the class around another class that will instantiate two different versions of the UserScript class, one specifically meant for iOS 14+ and the other for versions less than iOS 14.
This is because we need the ' @available(iOS 14.0, *)' header above the entire class in order to utilize WKContentWorld in this new build process

@ghensto
Copy link

ghensto commented Jun 9, 2022

@pichillilorenzo is there any work around until the issue get fixed?

@SethuSenthil
Copy link
Author

@pichillilorenzo is there any work around until the issue get fixed?

This is not really a workaround but might be helpful to someone, for now, you can just build through Xcode 13 after installing the Xcode 14 beta which comes with iOS 16 device support that is actually compatible with Xcode 13. In other words, you can build (for testing) for iOS 16 targets from Xcode 13 after you install the 14 beta alongside it. However, flutter run does not work so you always need to build through Xcode (you lose hot reloading) which might be a hassle.

@mikhael28
Copy link

Code Eagle's open PR resolves this issue.

@cimplesid
Copy link

cimplesid commented Sep 13, 2022

also exists on the Xcode 14.0 stable version

Temporary solution:
#1238 (comment)

@mirkancal
Copy link

I've simply fixed it by updating the platform to iOS 14 in Podfile.

https://stackoverflow.com/a/73699790/9779791

@riegersan
Copy link

riegersan commented Sep 13, 2022

@mirkancal but this means that you only support iOS 14 and higher

I used another git repo wich already has the fix included as workaround

flutter_inappwebview:
git: https://github.com/CodeEagle/flutter_inappwebview

@mirkancal
Copy link

@riegersan yes. 7 years old iPhone 6s has iOS 14. I'm okay with it.

@luan20495
Copy link

I fix update target 14 in file ios/Podfile
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'

@blue492
Copy link

blue492 commented Sep 26, 2022

dependency_overrides and flutter pub cache repair solved some problems, but android studio still showing the following issues when I try flutter build iOS or flutter run
I fixed these issues in Xcode pods page where I chose my apple developer account " Select a development team in the Signing & Capabilities editor". I could build the project and run it. BUT When I tried to build/run my project again I got the following errors again. It seems that the file restart itself.

How to fix it to avoid pods Signing & Capabilities again?

/Users/blue492/flutter/bin/flutter --no-color build ios
Building com.test.app for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: 432432532
Running pod install...                                              7.6s
Running Xcode build...                                          
Xcode build done.                                           19.0s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    Writing result bundle at path:
    	/var/folders/cc/3b8b8j7s3nd92qwt4_6zgzhh0000gn/T/flutter_tools.FkUIb7/flutter_ios_build_temp_dirCo3hLK/temporary_xcresult_bundle

    note: Building targets in dependency order
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'TOCropViewController-TOCropViewControllerBundle' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: error: Signing for "TOCropViewController-TOCropViewControllerBundle" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'TOCropViewController-TOCropViewControllerBundle' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'GoogleDataTransport' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'MLKitBarcodeScanning' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'nanopb' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'GTMSessionFetcher' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'SwiftyGif' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'Protobuf' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'MLKitCommon' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'ReachabilitySwift' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'MLKitVision' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'TOCropViewController' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'GoogleMLKit' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'DKImagePickerController' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'SDWebImage' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'MLImage' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'GoogleUtilities' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'DKImagePickerController-DKImagePickerController' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: error: Signing for "DKImagePickerController-DKImagePickerController" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'DKImagePickerController-DKImagePickerController' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'PromisesObjC' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'OrderedSet' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'DKPhotoGallery-DKPhotoGallery' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: error: Signing for "DKPhotoGallery-DKPhotoGallery" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'DKPhotoGallery-DKPhotoGallery' from project 'Pods')
    note: Run script build phase 'Run Script' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from project 'Runner')
    note: Run script build phase 'Thin Binary' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from project 'Runner')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'GoogleUtilitiesComponents' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'GoogleToolboxForMac' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'FMDB' from project 'Pods')
    /Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'DKPhotoGallery' from project 'Pods')

    Result bundle written to path:
    	/var/folders/cc/3b8b8j7s3nd92qwt4_6zgzhh0000gn/T/flutter_tools.FkUIb7/flutter_ios_build_temp_dirCo3hLK/temporary_xcresult_bundle


Error (Xcode): Signing for "TOCropViewController-TOCropViewControllerBundle" requires a development team. Select a development team in the Signing & Capabilities editor.
/Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj

Error (Xcode): Signing for "DKImagePickerController-DKImagePickerController" requires a development team. Select a development team in the Signing & Capabilities editor.
/Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj

Error (Xcode): Signing for "DKPhotoGallery-DKPhotoGallery" requires a development team. Select a development team in the Signing & Capabilities editor.
/Users/blue492/StudioProjects/app/ios/Pods/Pods.xcodeproj

Encountered error while building for device.
Process finished with exit code 1

@mirkancal
Copy link

mirkancal commented Sep 26, 2022

@blue492 it seems like the package is asking higher iOS target.

What's your target? It's in podfile, beginning of the file, in the line:
Probably it's commented out or less than 11. You can set 11 there.
platform :ios, 'X.0'

I'm also manually increasing with the Podfile script.

    if Gem::Version.new('11.0') > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
       config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
     end

image

@pichillilorenzo
Copy link
Owner

Released version 5.4.3+8 with pull request merged!

@Anna-Myzukina
Copy link

After updating Xcode to 14 version, I get this error and fixed it by changing in Podfile platform:ios to 14

  • open folder ios
  • open Podfile
  • in Podfile uncomment line number 2 and change "platform :ios, '14.0'"

Screenshot 2022-12-19 at 16 45 21

@jcpriascRZ
Copy link

I was getting the same error, and i had to update @stripe/stripe-react-native:
Screenshot 2023-03-21 at 4 02 46 pm

then i updated cocoapods with:
pod update

and change the platform :ios to '13.0'

Screenshot 2023-03-21 at 4 04 43 pm

@lyf571321556
Copy link

@mirkancal but this means that you only support iOS 14 and higher

I used another git repo wich already has the fix included as workaround

flutter_inappwebview: git: https://github.com/CodeEagle/flutter_inappwebview

this repo not exits.

@simranchawla20
Copy link

this was helpfull. Thanks:)

Copy link

github-actions bot commented Oct 6, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests