Sithira / FlutterRadioPlayer

Flutter Radio Player, A Plugin to handle streaming audio without a hassle
MIT License
139 stars 64 forks source link

lateinit property coreService has not been initialized. #24

Closed rafaelmpessoa closed 4 years ago

rafaelmpessoa commented 4 years ago

hello Sithira, nice package (:

Do you know why when I try to play this radio I'm getting this error? http://cms.sintonizar.radio.br:8088/cms/cms/icecast.audio

E/flutter (11581): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: PlatformException(error, lateinit property coreService has not been initialized, null)
E/flutter (11581): #0      StandardMethodCodec.decodeEnvelope 
package:flutter/…/services/message_codecs.dart:572
E/flutter (11581): #1      MethodChannel._invokeMethod 
package:flutter/…/services/platform_channel.dart:161
E/flutter (11581): <asynchronous suspension>
E/flutter (11581): #2      MethodChannel.invokeMethod 
package:flutter/…/services/platform_channel.dart:334
E/flutter (11581): #3      FlutterRadioPlayer.playOrPause 
Sithira commented 4 years ago

Hi, A

You need to initialize the player first ? Please check the examples i have provided :)

On Tue, 22 Sep 2020 at 6:18 AM, Rafael Menicucci Pessoa < notifications@github.com> wrote:

hello Sithira,

nice package (:

Do you know why when I try to play this radio I'm getting this error?

http://cms.sintonizar.radio.br:8088/cms/cms/icecast.audio

E/flutter (11581): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: PlatformException(error, lateinit property coreService has not been initialized, null)

E/flutter (11581): #0 StandardMethodCodec.decodeEnvelope

package:flutter/…/services/message_codecs.dart:572

E/flutter (11581): #1 MethodChannel._invokeMethod

package:flutter/…/services/platform_channel.dart:161

E/flutter (11581):

E/flutter (11581): #2 MethodChannel.invokeMethod

package:flutter/…/services/platform_channel.dart:334

E/flutter (11581): #3 FlutterRadioPlayer.playOrPause

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Sithira/FlutterRadioPlayer/issues/24, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6V3BPR4YLYTTVFOL7J5WDSG7X4PANCNFSM4RVE54FA .

-- Sent from Gmail Mobile for iPhone

rafaelmpessoa commented 4 years ago

Yes, I have checked your example and to get this error o just change the URL example for my URL.

Future<void> initRadioService() async {
    try {
      await _flutterRadioPlayer.init("Flutter Radio Example", "Live",
          "http://cms.sintonizar.radio.br:8088/cms/cms/icecast.audio", "false");
    } on PlatformException {
      print("Exception occurred while trying to register the services.");
    }
  }
Sithira commented 4 years ago

I have pushed a new update. Please check and let me know if this works :-)

Sithira commented 4 years ago

I have tested your URL and it works fine for me. Closing this issue now