youtube_player_flutter icon indicating copy to clipboard operation
youtube_player_flutter copied to clipboard

[BUG] Crash on iOS 14.5

Open yusriltakeuchi opened this issue 3 years ago • 21 comments

I think the player crash when testing on iOS 14.5, can you give an update for this issue? I'm still using version non null safety, it will be good if your release the version on non null safety.

Or give me instructions how to fix this

yusriltakeuchi avatar Apr 28 '21 07:04 yusriltakeuchi

There is nothing error in console when crash happend, so i don't know why

yusriltakeuchi avatar Apr 28 '21 07:04 yusriltakeuchi

This is crash log when i debug with XCode

Screen Shot 2021-04-28 at 14 44 12

khanhuitse05 avatar Apr 28 '21 07:04 khanhuitse05

The problem is on dependency plugin - 'userAgent' has not parsed.

adaskaliuk avatar Apr 28 '21 08:04 adaskaliuk

also got same problem

muhajirdev avatar Apr 28 '21 10:04 muhajirdev

flutter_inappwebview plugin causes the problem. This is just a workaround, I modified method parse(options: [String: Any?]) in Options.swift as below, and it works.

    func parse(options: [String: Any?]) -> Options {
        for (key, value) in options {
            if !(value is NSNull) {
                if self.responds(to: Selector(key)) {
                    self.setValue(value, forKey: key)
                }
            }
        }
        return self
    }

NAKANISYNTH avatar Apr 28 '21 10:04 NAKANISYNTH

oh, waw. could you share more about this @NAKANISYNTH , it would be very helpful? where do I find Options.swift?

muhajirdev avatar Apr 28 '21 10:04 muhajirdev

This file? https://github.com/pichillilorenzo/flutter_inappwebview/blob/4469ec7/ios/Classes/Options.swift#L17-L24

gyamoto avatar Apr 28 '21 10:04 gyamoto

@gyamoto Yes, that's it! @muhajirdev Option.swift is in dependency plugin 'flutter_inappwebview'. So open Runner.xcworkspace in your repo and search Option.swift on it.

NAKANISYNTH avatar Apr 28 '21 10:04 NAKANISYNTH

Thanks @NAKANISYNTH . It work!

khanhuitse05 avatar Apr 28 '21 10:04 khanhuitse05

Is there an issue in https://github.com/pichillilorenzo/flutter_inappwebview/ to address this?

ItsCalebJones avatar Apr 29 '21 18:04 ItsCalebJones

hey guys, I am not really sure where to find it.

image

image

is it somewhere here?

muhajirdev avatar Apr 30 '21 05:04 muhajirdev

I can't find flutter_inappweview

muhajirdev avatar Apr 30 '21 05:04 muhajirdev

@muhajirdev Press Shift + Command + O and search for Options.swift.

shahankit-dunzo avatar Apr 30 '21 05:04 shahankit-dunzo

I can't find it too, any idea why? image

I am using this plugin, version 6.1.1 btw

Also I tried to list the external dependencies here, in Android studio. Looks like youtube_player_flutter and flutter_inappwebview are not here. But it's in my pubpsec.yaml

image

muhajirdev avatar Apr 30 '21 05:04 muhajirdev

flutter_inappwebview plugin causes the problem. This is just a workaround, I modified method parse(options: [String: Any?]) in Options.swift as below, and it works.

    func parse(options: [String: Any?]) -> Options {
        for (key, value) in options {
            if !(value is NSNull) {
                if self.responds(to: Selector(key)) {
                    self.setValue(value, forKey: key)
                }
            }
        }
        return self
    }

This problem fixed when i try this one, thank youu so much!

yusriltakeuchi avatar Apr 30 '21 10:04 yusriltakeuchi

you can forceHD: true, as well while creating YoutubePlayerController and passing YoutubePlayerFlags object as temporary solution.

It's also related to applaypay as per the author of pichillilorenzo/flutter_inappwebview see

rahul-bst avatar May 08 '21 21:05 rahul-bst

I faced the same issue and it was solved once flutter is upgraded to 2.0

KatyTao avatar May 13 '21 10:05 KatyTao

In our case, we encountered a crash in iOS 14.5 while using Flutter 2.2 and version 7.0.0+7 of the package. Upgrading to 8.0.0 fixes the crash.

indyfromoz avatar Jun 15 '21 23:06 indyfromoz

Screenshot 2021-09-01 at 10 40 55 AM in case if you guys are unable to find Options.swift, try to search like this

Akash-Neeli avatar Sep 01 '21 05:09 Akash-Neeli

Another way to find this file from vscode is:

Open dependencies tab, and search for flutter_inappwebview

Screen Shot 2021-11-04 at 08 07 17

thiagocarvalhodev avatar Nov 04 '21 11:11 thiagocarvalhodev

To anyone that is having this issue on youtube_player_iframe, I fixed it.

Just add

youtube_player_iframe:
    git: 
      url: https://github.com/thiagocarvalho0877/youtube_player_flutter.git
      path: ./packages/youtube_player_iframe
      ref: fix-inappwebview

https://github.com/thiagocarvalho0877/youtube_player_flutter

thiagocarvalhodev avatar Nov 04 '21 12:11 thiagocarvalhodev