Sithira / FlutterRadioPlayer

Flutter Radio Player, A Plugin to handle streaming audio without a hassle
BSD 3-Clause "New" or "Revised" License
137 stars 63 forks source link

Build time issue #75

Closed timonsk closed 1 year ago

timonsk commented 1 year ago

hey all! I'm getting this build error during the time when I've added the radio player as a dependency:

FlutterRadioPlayer/android/src/main/kotlin/me/sithiramunasinghe/flutter/flutter_radio_player/core/StreamingCore.kt: (22, 17): Unresolved reference: localbroadcastmanager
FlutterRadioPlayer/android/src/main/kotlin/me/sithiramunasinghe/flutter/flutter_radio_player/core/StreamingCore.kt: (34, 93): Unresolved reference: broadcastActionName

and a bunch more, Could you please help me with this?

Sithira commented 1 year ago

I think it's an env issue. But I'm not sure for a certain

timonsk commented 1 year ago

I've tried to pull the repo and simply build I've got the same issues. so I've started to fix it and when I've added import androidx.localbroadcastmanager.content.LocalBroadcastManager to StreamingCore.kt it fixed the first error but not the second(( so trying to fix that as well. Can I imply adding a dependency to my app and not building or rebuilding all of that? @Sithira

Sithira commented 1 year ago

Whats the SDK that you are trying to run this on ?

timonsk commented 1 year ago

@Sithira

Flutter 3.0.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 85684f9300 (5 months ago) • 2022-06-30 13:22:47 -0700
Engine • revision 6ba2af10bb
Tools • Dart 2.17.5 • DevTools 2.12.2
frzjac commented 1 year ago

the same happens in

Flutter 3.3.8 • channel stable • https://github.com/flutter/flutter.git Framework • revision 52b3dc25f6 (7 days ago) • 2022-11-09 12:09:26 +0800 Engine • revision 857bd6b74c Tools • Dart 2.18.4 • DevTools 2.15.0

e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (34, 93): Unresolved reference: broadcastActionName e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (35, 93): Unresolved reference: broadcastChangedMetaDataName e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (54, 42): Unresolved reference: broadcastActionName e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (55, 50): Unresolved reference: broadcastChangedMetaDataName e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (198, 44): Unresolved reference: EventListener e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (200, 13): 'onPlayerStateChanged' overrides nothing e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (227, 13): 'onPlayerError' overrides nothing e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (236, 28): Type mismatch: inferred type is but Player.Listener was expected e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (242, 17): Unresolved reference: addMetadataOutput e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (243, 31): Unresolved reference: it e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (248, 63): Unresolved reference: createWithNotificationChannel

e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (313, 37): Unresolved reference: setFastForwardIncrementMs e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (314, 37): Unresolved reference: setRewindIncrementMs e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (316, 37): Unresolved reference: setUseNavigationActions e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (317, 37): Unresolved reference: setUseNavigationActionsInCompactView e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (375, 52): Unresolved reference: broadcastActionName e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (386, 87): Type mismatch: inferred type is Uri! but MediaItem was expected e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_radio_player-2.0.0\android\src\main\kotlin\me\sithiramunasinghe\flutter\flutter_radio_player\core\StreamingCore.kt: (387, 97): Type mismatch: inferred type is Uri! but MediaItem was expected

FAILURE: Build failed with an exception.

Run with --info or --debug option to get more log output. Run with --scan to get full insights.

BUILD FAILED in 8s Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm)

var2611 commented 1 year ago

By inspecting the previous commit,

Commit on 25 Jan, 2021, broadcastActionName's constant value is defined over there in FlutterRadioPlayerPlugin.kt file. https://github.com/Sithira/FlutterRadioPlayer/commit/3b7a580f8ed705038c74de4eb07b423e74c026cb

But in recent commit 15 Oct, 2022, FlutterRadioPlayerPlugin.kt file is changed but there is no update in StreamingCore.kt https://github.com/Sithira/FlutterRadioPlayer/commit/d329ebceb4330d2344e4a3b9eea2480c7889f7d4

timonsk commented 1 year ago

@Sithira any updates on how to fix this in the library?

blauerwolf commented 1 year ago

Same here. Any solution or hack to be able to compile without errors?

taudas commented 1 year ago

double plus me too!

xyzbilal commented 1 year ago

any solution yet?

timonsk commented 1 year ago

no( maybe we can do the fix by our self and send a PR?

xyzbilal commented 1 year ago

no( maybe we can do the fix by our self and send a PR? We would if we were expert on android and kotlin. but the better solution for now changing package we use in project and I guess this is the best alternative https://pub.dev/packages/audio_service

timonsk commented 1 year ago

no( maybe we can do the fix by our self and send a PR? We would if we were expert on android and kotlin. but the better solution for now changing package we use in project and I guess this is the best alternative https://pub.dev/packages/audio_service

does it support icecast streams?

Sithira commented 1 year ago

been busy with work. Will soon look into this. Sorry for the delay

wendl4 commented 1 year ago

@Sithira may I ask you what's the progress for this?

wendl4 commented 1 year ago

I made some changes to update exoplayer code in the StreamingCore.kt as a temporary solution for this in forked repo. If anyone interested https://github.com/wendl4/FlutterRadioPlayer/commit/463f16f3ca7e7f56248b434f7e7b9921c14f7a80 .

markfili commented 1 year ago

hey all, the StreamingCore.kt is not used anywhere, I guess @Sithira forgot to delete it before pushing his changes. check out this PR https://github.com/Sithira/FlutterRadioPlayer/pull/78 and feel free to try and build it locally; the quickest way is to add this to your project's pubspec.yaml:

dependencies:
  ...
  flutter_radio_player:
    git:
      url: https://github.com/markfili/FlutterRadioPlayer.git
Sithira commented 1 year ago

Hi everyone, this should be fixed by the new update. Sorry for the delay