ryanheise / just_audio

Audio Player
1.01k stars 616 forks source link

issingPluginException(No implementation found for method init on channel com.ryanheise.just_audio.methods) #1026

Open dangmt-se opened 11 months ago

dangmt-se commented 11 months ago

Which API doesn't behave as documented, and how does it misbehave? Name here the specific methods or fields that are not behaving as documented, and explain clearly what is happening.

I implemented the plug-in in Flutter Web and it's working like a charm on my local host. But when I test run the project on my generated github.io site, the music app does not play.

Minimal reproduction project Provide a link here using one of two options:

  1. "The example".]

To Reproduce (i.e. user steps, not code) Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Error messages

Uncaught MissingPluginException(No implementation found for method init on channel com.ryanheise.just_audio.methods)
at Object.f (https://cretaisland.github.io/creta03_v3/main.dart.js:4445:3)
at https://cretaisland.github.io/creta03_v3/main.dart.js:144060:15
at c6w.a (https://cretaisland.github.io/creta03_v3/main.dart.js:5762:62)
at c6w.$2 (https://cretaisland.github.io/creta03_v3/main.dart.js:67043:14)
at c3H.$1 (https://cretaisland.github.io/creta03_v3/main.dart.js:67037:21)
at aDn.adc (https://cretaisland.github.io/creta03_v3/main.dart.js:68066:34)
at bPe.$0 (https://cretaisland.github.io/creta03_v3/main.dart.js:67453:11)
at Object.RV (https://cretaisland.github.io/creta03_v3/main.dart.js:5899:40)
at aM.x7 (https://cretaisland.github.io/creta03_v3/main.dart.js:67374:3)
at bP6.$0 (https://cretaisland.github.io/creta03_v3/main.dart.js:67420:13)

Expected behavior The app can play music on the .github.io site

Desktop (please complete the following information):

Flutter SDK version

[✓] Flutter (Channel stable, 3.10.6, on Microsoft Windows [Version 10.0.22621.1992], locale en-US)
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✗] Android toolchain - develop for Android devices
    ✗ ANDROID_HOME = C:\dev\sdk
      but Android SDK not found at this location.
[✓] Chrome - develop for the web
[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.4)
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.80.1)
[✓] Connected device (3 available)
[✓] Network resources

! Doctor found issues in 1 category.
ryanheise commented 11 months ago

Just to confirm, this error was produced using the official example, according to the reproduction instructions above?

dangmt-se commented 11 months ago

Yes,, it was. Running on local is fine but it seems like the plug-in has problem with the github host?

ryanheise commented 11 months ago

Can you please paste the error message in plain text within a code block?

Edit: and also, edit your existing bug report to use this format.

dangmt-se commented 11 months ago

Is it what you meant?

Uncaught MissingPluginException(No implementation found for method init on channel com.ryanheise.just_audio.methods) at Object.f (https://cretaisland.github.io/creta03_v3/main.dart.js:4445:3) at https://cretaisland.github.io/creta03_v3/main.dart.js:144060:15 at c6w.a (https://cretaisland.github.io/creta03_v3/main.dart.js:5762:62) at c6w.$2 (https://cretaisland.github.io/creta03_v3/main.dart.js:67043:14) at c3H.$1 (https://cretaisland.github.io/creta03_v3/main.dart.js:67037:21) at aDn.adc (https://cretaisland.github.io/creta03_v3/main.dart.js:68066:34) at bPe.$0 (https://cretaisland.github.io/creta03_v3/main.dart.js:67453:11) at Object.RV (https://cretaisland.github.io/creta03_v3/main.dart.js:5899:40) at aM.x7 (https://cretaisland.github.io/creta03_v3/main.dart.js:67374:3) at bP6.$0 (https://cretaisland.github.io/creta03_v3/main.dart.js:67420:13)

ryanheise commented 11 months ago

That's not in a code block. The original bug report template included a code block and you just needed to insert the error message between the start and end of that code block. Maybe you ignored it and deleted it. Here is an example:

This is a code block

Use a fence above and below (a row of 3 back ticks). And edit your original report rather than adding more comments below.

dangmt-se commented 11 months ago

Thank you! I put the error message within the 3 back ticks now.

Uncaught MissingPluginException(No implementation found for method init on channel com.ryanheise.just_audio.methods)
at Object.f (https://cretaisland.github.io/creta03_v3/main.dart.js:4445:3)
at https://cretaisland.github.io/creta03_v3/main.dart.js:144060:15
at c6w.a (https://cretaisland.github.io/creta03_v3/main.dart.js:5762:62)
at c6w.$2 (https://cretaisland.github.io/creta03_v3/main.dart.js:67043:14)
at c3H.$1 (https://cretaisland.github.io/creta03_v3/main.dart.js:67037:21)
at aDn.adc (https://cretaisland.github.io/creta03_v3/main.dart.js:68066:34)
at bPe.$0 (https://cretaisland.github.io/creta03_v3/main.dart.js:67453:11)
at Object.RV (https://cretaisland.github.io/creta03_v3/main.dart.js:5899:40)
at aM.x7 (https://cretaisland.github.io/creta03_v3/main.dart.js:67374:3)
at bP6.$0 (https://cretaisland.github.io/creta03_v3/main.dart.js:67420:13)
ryanheise commented 11 months ago

You didn't edit your original report. The screenshot is still there.

dangmt-se commented 11 months ago

I edited my original report. Please check, thank you!

ryanheise commented 11 months ago

Do you have a link to the github.io site?

dangmt-se commented 11 months ago

I do... but it is used only within the company only. Sorry I couldn't provide it due to confidential issue :(

ryanheise commented 11 months ago

It's my code we're talking about here, since you said this is the official example.

dangmt-se commented 11 months ago

Your code is working fine on the local host and having trouble on the gihub.io platform. Just thought there're something to do with the plug-in permission or dependencies... Sorry again, I can't provide more details on the github.io site.

ryanheise commented 11 months ago

So is the problem with github.io specifically? Or can you verify that it is a problem with just_audio_web (e.g. by showing that it also fails in the same way on a regular web server)?

dangmt-se commented 11 months ago

That's right. The problem is with github.io specifically. It works well on the localhost chrome.

ryanheise commented 11 months ago

I don't mean localhost, I mean a regular web server. If you are able to install apache or nginx locally, you may test that to verify if those work.

dangmt-se commented 11 months ago

Thank you! I will test on those and get back to you!

dangmt-se commented 11 months ago

Hi, I test the web application on nginx and the plug-ins work fine there too. So it means that the problem is only with gihub.io then.

B0yma commented 7 months ago

Have the same issue - on firebase hosting

Thank you! I put the error message within the 3 back ticks now.

Uncaught MissingPluginException(No implementation found for method init on channel com.ryanheise.just_audio.methods)
at Object.f (https://cretaisland.github.io/creta03_v3/main.dart.js:4445:3)
at https://cretaisland.github.io/creta03_v3/main.dart.js:144060:15
at c6w.a (https://cretaisland.github.io/creta03_v3/main.dart.js:5762:62)
at c6w.$2 (https://cretaisland.github.io/creta03_v3/main.dart.js:67043:14)
at c3H.$1 (https://cretaisland.github.io/creta03_v3/main.dart.js:67037:21)
at aDn.adc (https://cretaisland.github.io/creta03_v3/main.dart.js:68066:34)
at bPe.$0 (https://cretaisland.github.io/creta03_v3/main.dart.js:67453:11)
at Object.RV (https://cretaisland.github.io/creta03_v3/main.dart.js:5899:40)
at aM.x7 (https://cretaisland.github.io/creta03_v3/main.dart.js:67374:3)
at bP6.$0 (https://cretaisland.github.io/creta03_v3/main.dart.js:67420:13)

^^^

Do you have a link to the github.io site?

B0yma commented 7 months ago

so my solution:

in your main.dart need to manually register plugin for web:

...
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
...

*YOUR PLUGIN*.registerWith(webPluginRegistrar);
tarunsachdeva001 commented 2 months ago

@B0yma Can you please more details of how you resolve this issue. I am also facing same issue that audio is not working after deploy on firebase.

YOUR PLUGIN.registerWith(webPluginRegistrar); //Can you complete this line w.r.t plugin.

it will be really helpful.

Thank you

B0yma commented 2 months ago

@B0yma Can you please more details of how you resolve this issue. I am also facing same issue that audio is not working after deploy on firebase.

YOUR PLUGIN.registerWith(webPluginRegistrar); //Can you complete this line w.r.t plugin.

it will be really helpful.

Thank you

@tarunsachdeva001 Hello, actually you dont this but if nothing work for the case with this - JustAudioPlugin.registerWith(registrar); So the core problem is in the cache, try to run command - flutter upgrade - then try to delete in your project folder, folders: .dart_tool, .firebase