sarbagyastha / youtube_player_flutter

A Flutter plugin for inline playback or streaming of YouTube videos using the official iFrame Player API.
https://youtube.sarbagyastha.com.np
BSD 3-Clause "New" or "Revised" License
701 stars 810 forks source link

xcode build failure on xcode 15[BUG] #873

Open AmgadMahmoud opened 1 year ago

AmgadMahmoud commented 1 year ago

Describe the bug xcode build failure when running in ios 17 using xcode 15 with error Failed to build iOS app Error (Xcode): type argument 'nw_proxy_config_t' (aka 'struct nw_proxy_config *') is neither an Objective-C object nor a block type /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h:119:46

Parse Issue (Xcode): Could not build module 'WebKit' /build/ios/Debug-iphonesimulator/flutter_inappwebview/flutter_inappwebview.framework/Headers/flutter_inappwebview-Swift.h:893:8

Could not build the application for the simulator. Error launching application on iPhone 15 Pro Max.

To Reproduce Steps to reproduce the behavior: update xcode to latest version 15 try to run the app on iphone ios 17 build will fail

Expected behavior A clear and concise description of what you expected to happen. I expect the app to run without issues but build fails

Screenshots If applicable, add screenshots to help explain your problem.

Technical Details:

Additional context Add any other context about the problem here.

manhhaiphp commented 1 year ago

I have the same problem

mechaadi commented 1 year ago

Temporary Fix, add this to dependency_overrides

flutter_inappwebview:
  git:
    url: https://github.com/Estrelio/flutter_inappwebview.git
    ref: fix-xcode-17  
rusfearuth commented 1 year ago

Refere

Still showing the error:

Error (Xcode):
../../../.pub-cache/hosted/pub.dev/youtube_player_flutter-8.1.2/lib/src/player/raw_youtube_playe
r.dart:79:56: Error: The argument type 'Uri' can't be assigned to the parameter type 'WebUri?'.
luizKorg commented 1 year ago

I tried (and it worked) this temporary solution of hard-changing the file to accept iOS less than 18.

babbage commented 1 year ago

This problem is caused by this package's dependency flutter_inappwebview. They have released a v5.8.0 update that fixes this issue. Please update your dependency to resolve this issue. This is a high priority for us.

In the meantime, consumers of this package can resolve the build error by importing the higher version of the dependency explicitly in their pubspec.yaml:

  flutter_inappwebview: 5.8.0 # required for Xcode 15 until youtube_player_flutter updates its dependencies
jagiro commented 11 months ago

@sarbagyastha please, accept the pull request. Thanks