Open christiancg opened 2 years ago
Was this ever solved? it seems to still be happening
I think that the issue is still happening as it was never addressed either by this library or audio service
I got it to work. I have a mainBinding
for all GetX
and called from there. Instead of using a separate service GetxService
I called using await Get.putAsync
and get the AudioService
ATTENTION: DO NOT USE THIS FIELD TO ASK SUPPORT QUESTIONS. USE THE PLATFORM CHANNELS FOR THIS. THIS SPACE IS DEDICATED ONLY FOR BUGS DESCRIPTION. Fill in the template. Issues that do not respect the model will be closed.
Describe the bug Seems that using flutter 3 (stable channel), while on Android, if you use getx (latest version -> 4.6.3) alongside audio_service (latest version -> 0.18.4), when you make Get.put() or Get.lazyPut() of any service, you will see in the console that the service is created and initialized twice. This is only happening for Android, it is working correctly in iOS. This causes errors while instantiating some services that need only one instance. In my case, it is causing errors with the local database (Objectbox).
Reproduction code NOTE: THIS IS MANDATORY, IF YOUR ISSUE DOES NOT CONTAIN IT, IT WILL BE CLOSED PRELIMINARY)
example:
To Reproduce Steps to reproduce the behavior: Run the code above on any Android device (won't happen in any iOS device)
Expected behavior Only one instance of each service should be created and initialized
Screenshots
Flutter Version: Flutter 3.0.0 • channel stable • https://github.com/flutter/flutter.git Framework • revision ee4e09cce0 (9 days ago) • 2022-05-09 16:45:18 -0700 Engine • revision d1b9a6938a Tools • Dart 2.17.0 • DevTools 2.12.2
Getx Version: 4.6.3
Describe on which device you found the bug: Any android device
Minimal reproduce code Provide a minimum reproduction code for the problem (with getx 4.6.3 and audio_service 0.18.4 installed)