Audioplayers ^0.20.1

0 views
Skip to first unread message

Lavonda Busing

unread,
Aug 3, 2024, 1:45:03 PM8/3/24
to smugdatecnea

I am trying to use the flutter audioplayers package to play audio files and am getting this error. While following an online flutter tutorial I had this exact code and it ran and produced sound correctly, but now it doesn't play audio. I think maybe there is a change in my IDE settings or a change on my computer, but I don't know how to find the issue.

I don't know if you've fixed your issue or not. I had the same issue, The choice that I had and possibly yourself was to get a different package or connect your own phone instead of emulator, I found when I connected my own phone (galaxy note9) I had no problems anymore ?.

Im creating a flutter app that requires a user to complete certain tasks in order to stop an alarm clock. Its a more imersive alarm clock app that could help stimulate the brain in order to aid in the process of waking up.

Im having some issues working with the hardware for the application, so to simulate an alarm going off im trying to use the audioplayers package to play an mp3 file once a button is pressed. Im aware that in order to use a local mp3 file I must utilize audio_cache with audioplayers.

Im also having trouble putting the local mp3 file that I want into my pubspec.yaml. The readMe for audio cache states that I have to place the file in my assest folder and specify the file path in my pubspec under assets. However I do not see an assets folder. I created a file named assets and placed the mp3 in there, but I dont belive this is what I was supposed to do. I also belive that I am placing the file path into my pubspec wrong as well.

The plugins audioplayers, path_provider use a deprecated version ofthe Android embedding. To avoid unexpected runtime failures, or futurebuild failures, try to see if these plugins support the Android V2embedding. Otherwise, consider removing them since a future release ofFlutter will remove these deprecated APIs. If you are plugin author,take a look at the docs for migrating the plugin to the V2 embedding: -plugin-migration.

I was having the same problem while using audioplayers library. So, after looking up on the internet I found out that I was using the old version of the dependency of audio player. So, I suggest you to check for the latest version of audioplayers library from , and add it in your dependency as

BUILD FAILED in 56sRunning Gradle task 'assembleRelease'...Running Gradle task 'assembleRelease'... Done 57.7sThe built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solvethe incompatibility.Building plugin audioplayers...Running Gradle task 'assembleAarRelease'...Running Gradle task 'assembleAarRelease'... Done 2.0s

I'm not an expert with Android nor Flutter, but after many tests it seems that the issue isn't related to a package your recently installed, but with the size of the build! I was getting errors related to audioplayers, assets_audio_player, multiple Firebase packages and so on.

Changed the order, but this made the error shift to Firebase. I recently added Craslytics and this made me think it's because I used a newer version compared to the 1-2 months old packages. I thought it was the time to upgrade to 8.x, but that didn't make sense either. Never had such issues with any FB service/

Android developers know that APK size is an important factor in user engagement. Code shrinking helps reduce the size of your APK by getting rid of unused code and resources as well as making your actual code take less space (also known as minification or obfuscation).

How can I play the same audio file as many times as I want, not loop but I want the possibility to precise how many times, I followed this tutorial to make the basics which mean the play/pause function. And I'm struggling with the rest.I use the last version of the audioplayers package.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages