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.31k stars 1.64k forks source link

[CRITICAL] XCode 16.1 fails to build #2327

Open felipecastrosales opened 1 month ago

felipecastrosales commented 1 month ago

Is there an existing issue for this?

Current Behavior

Current behaviour is that appears problems like:

Overriding 'init' must be as available as declaration it overrides

image

And others like:

image

I was trying solve this errors and when I fixed and put to build the error was increased to 50 exceptions:

image

I would like @pichillilorenzo and other developers who maintain this plugin to fix this, because it seems like a bigger deal to fix and there may be an easier way than what I was trying.

Thanks!

Expected Behavior

That works as expected and build for using Xcode16.1. :)

Steps with code example to reproduce

Only build an Flutter app.

Stacktrace/Logs

Overriding 'init' must be as available as declaration it overrides


Protocol 'WKUIDelegate' requires 'webView(_:willPresentEditMenuWithAnimator:)' to be available in iOS 16.0 and newer


Protocol 'WKUIDelegate' requires 'webView(_:requestMediaCapturePermissionFor:initiatedByFrame:type:decisionHandler:)' to be available in iOS 12.0 and newer


Protocol 'WKUIDelegate' requires 'webView(_:requestDeviceOrientationAndMotionPermissionFor:initiatedByFrame:decisionHandler:)' to be available in iOS 12.0 and newer


etc.

Flutter version

v3.24.0

Operating System, Device-specific and/or Tool

iOS specifically

Plugin version

v6.1.4

Additional information

I've seen issues from others related to XCode 16, but Xcode 16.1 has other bugs that are very different from the previous ones.

Self grab

felipecastrosales commented 1 month ago

Please change the deployment target ios version 14

I saw your suggestion a few hours ago and was going to test it as soon as I started work, but thinking about it now, I don't think that's a good idea because I'll lose access to other versions that my application supports.

felipecastrosales commented 1 month ago

Ok, I can try this but I think that this is not the best way to follow. @pichillilorenzo can you suggest anything?

Imgkl commented 1 month ago

@ARULNITHI0414 Didn't work.

felipecastrosales commented 1 month ago

@ARULNITHI0414 I tried with version 14 and 15 and doesn't work as expected. It's the same error.

image

felipecastrosales commented 1 month ago

I want to add, I don't think bump to version 14.0 is the best option. The maintainers must have a better solution.

aorohith commented 1 month ago

I have forked and changed in ios, Now the build issue is solved and working fine. MAKE SURE ADDED THE SAME IN DEPENDENCY OVERRIDE SECTION Please use the below as a dependency for now flutter_inappwebview: git: url: https://github.com/aorohith/flutter_inappwebview.git path: flutter_inappwebview ref: master created a pull request #2336

felipecastrosales commented 1 month ago

@aorohith I saw your proposal, but I don't think it's correct - at least not completely. I haven't tested it yet, but I gave it a review.

lstonussi commented 1 month ago

I'm facing a similar issue after updating to Xcode 16. Any solutions?

Marko1994 commented 1 month ago

@aorohith your solution works as expected, Thank you so much

felipecastrosales commented 1 month ago

@aorohith I tried using your implementation and kept with problems for me. And I make flutter clean and "pod cleans" relateds.

image

felipecastrosales commented 1 month ago

Also, when I use last version of this plugin I receive this error:

image

When I bumped to 14 as latest version for IPHONEOS_DEPLOYMENT_TARGET and on platform :ios, '14.0', generate these errors:

image

I really appreciate that this issue has been resolved, because this will happen to more people in the future.

Marko1994 commented 1 month ago

@felipecastrosales have you tried deleting all pods and podfile.lock ? And than "pod install" or "pod update"

felipecastrosales commented 1 month ago

@Marko1994 yes, all commands. like: rm -rf Podfile.lock && pod repo update && pod update && pod install --verbose, pod repo remove trunk, pod deintegrate etc.

Marko1994 commented 1 month ago

@felipecastrosales Strange

Marko1994 commented 1 month ago

@felipecastrosales Let me tell you what I have followed

Step 1: add forked repo in pubspec instead of the version one, Like this

flutter_inappwebview: git: url: https://github.com/aorohith/flutter_inappwebview.git path: flutter_inappwebview ref: master

Step 2: add flutter_inappwebview 6.x whatever you used in dependency_override, like this

dependency_overrides: flutter_inappwebview: ^6.0.0

Step 3: clean pod and pod update

and it works

felipecastrosales commented 1 month ago

@Marko1994, still isn't working as expected. Could you share your pubspec.yaml file here as an example of how you implemented it?

aorohith commented 1 month ago

@felipecastrosales Use the same forked package as the dependency override instead of pub package

git: url: https://github.com/aorohith/flutter_inappwebview.git path: flutter_inappwebview ref: master

felipecastrosales commented 1 month ago

@aorohith using your recommendation I have this problems:

image

felipecastrosales commented 1 month ago

After that I bump my minimum iOS version to 14.0 and IPHONEOS_DEPLOYMENT_TARGET to 14.

image

felipecastrosales commented 1 month ago

I tried more onetime using a new version of XCode (beta 3) + iPhone 16 Pro Max simulator and I receive this now:

image

felipecastrosales commented 1 month ago

Now with iPhone 16 Pro Max (18.0) using XCode 16.0.

image

I'm currently using macos 15.0.1.

felipecastrosales commented 1 month ago

All of tests are on your fork @aorohith and using as override. cc @Marko1994

aorohith commented 1 month ago

@felipecastrosales Let me share my settings

  1. Mac OS version : 15.0.1 (24A348)
  2. Xcode : Version 16.0 (16A242d)
  3. Fluter. : 2.24.0
  4. Dart : 3.5.0
  5. Using the forked flutter_inappwebview in both dependency and dependency_overrides section
  6. In pod file and minimum iOS version to 13.0 Also in pod file added this code
Screenshot 2024-10-14 at 10 42 06 PM

Still, I am not sure about the issue you are facing. Add the line below to the pod file like above and try. config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'

felipecastrosales commented 1 month ago

@aorohith i'm trying now with:

felipecastrosales commented 1 month ago

@aorohith I've been testing your alternative and variations but I've had several problems. several indeed. If I use Flutter 3.24.0, xcode 16.0 with mac 15.0.1, with the fork in both and doing this configuration I have errors like:

image

image

I tested several simulators and on 2 different physical devices, the result was always errors of this type.

I really keep thinking there's something that needs to be tweaked in this plugin and I'd like @pichillilorenzo to look into it.

pichillilorenzo commented 1 month ago

Sorry guys, I will take a look into it as soon as possible. In the meantime, could you just use XCode 16.0 instead of XCode 16.1? You can have multiple XCode versions installed on your machine. Rename it with a different name. You can download it from https://developer.apple.com/download/all/?name=Xcode

felipecastrosales commented 1 month ago

@pichillilorenzo thanks for answer. I tried with different versions of XCode. After each test and installation I always delete the old one and restart the machine, to make sure it would restart. I was unable to use version 16.0 with Mac 15.0.1 and had the above problems.

felipecastrosales commented 3 weeks ago

Any news?

hieutran1999 commented 5 days ago

same issue