inway / flutter_ringtone_player

Simple Flutter plugin to play ringtone, alarm & notification sounds
MIT License
89 stars 57 forks source link

Unhandled Exception: MissingPluginException(No implementation found for method play on channel flutter_ringtone_player) #16

Closed Bharavi26 closed 1 year ago

Bharavi26 commented 3 years ago

flutter_ringtone_player: 2.0.0 already did flutter clean and get , but still getting missingpluginexception

Unhandled Exception: MissingPluginException(No implementation found for method play on channel flutter_ringtone_player) ringtoneplayer

91priyansh commented 3 years ago

@Bharavi26 need to register plugin in appplication.kt if you are using this in firebase backgroundmessagehandler

mmustafavistech commented 3 years ago

any working on this?

91priyansh commented 3 years ago

@mmustafavistech i found the solution

i have added these lines in my application.kt file..

if (!registry!!.hasPlugin("io.inway.ringtone.player")) { FlutterRingtonePlayerPlugin.registerWith(registry!!.registrarFor("io.inway.ringtone.player.FlutterRingtonePlayerPlugin")) }

and do not forget to import import io.inway.ringtone.player.FlutterRingtonePlayerPlugin

if you wanted to see full file link is here https://github.com/91priyansh/facetime/blob/main/android/app/src/main/kotlin/com/facetime/face_time/facetime/Application.kt

hemabhravee commented 2 years ago

I'm facing the same issue, and I'm not using firebase backgroundmessagehandler. Any suggestions?

sayak87 commented 2 years ago

@91priyansh thank you so much that worked like a charm!

karebet commented 2 years ago

I'm facing the same issue, and I'm not using firebase backgroundmessagehandler. Any suggestions?

@hemabhravee if you see a reference from @91priyansh . you see a Firebase Plugin, if you don't use Firebase you just delete it. example :

import io.flutter.embedding.android.FlutterActivity
import io.flutter.plugin.common.PluginRegistry
import io.inway.ringtone.player.FlutterRingtonePlayerPlugin

class MainActivity: FlutterActivity(),PluginRegistry.PluginRegistrantCallback  {
     override fun registerWith(registry: PluginRegistry?) {
        if (!registry!!.hasPlugin("io.inway.ringtone.player")) {
            FlutterRingtonePlayerPlugin.registerWith(registry!!.registrarFor("io.inway.ringtone.player.FlutterRingtonePlayerPlugin"))
        }
    }
}
nibiru2O12 commented 2 years ago

experienced this on windows.

try enabling developer mode:

run: start ms-settings:developers

chitraarasu commented 1 year ago

Just stop the app and re-run the app. It would work

github-actions[bot] commented 1 year ago

This issue has stalled.

github-actions[bot] commented 1 year ago

This issue has been closed due to inactivity.