[BUG]: flutterSoundHelper.convertFile crash on release app
See original GitHub issueFlutter Sound Version :
-
FULL flavor ?
-
Important: Result of the command :
flutter pub deps | grep flutter_sound
Severity
- Crash on release app
Platforms you faced the error
-
Android
-
Real device
Describe the bug On debug mode, i used flutterSoundHelper.convertFile to convert the temp file created by the recorder to permanent file; i record on aac as temp and convert to premanent mp3; this work well on debug, but when i build a release app, record work well, but when on convert , the app crash, i said that is the convert the problem cause i put a specifi button to convert aac to mp3, and when the button clicked, the app crash,
Logs!!!
i put some try catch on my code to see the output, this is the log on debug
I/flutter (14966): ---------------------------------------- I/flutter (14966): convert start I/flutter (14966): ---------------------------------------- D/flutter-ffmpeg(14966): Running FFmpeg with arguments: [-loglevel, error, -y, -i, /data/user/0/com.example.topos/cache/300621-19#58-Bornage-Immatriculation.aac, /storage/emulated/0/Topos/300621-19#58-Bornage-Immatriculation.mp3]. I/mobile-ffmpeg(14966): Loading mobile-ffmpeg. I/mobile-ffmpeg(14966): Loaded mobile-ffmpeg-full-arm64-v8a-4.4-lts-20200724. D/mobile-ffmpeg(14966): Callback thread started. D/flutter-ffmpeg(14966): FFmpeg exited with rc: 0 I/flutter (14966): ---------------------------------------- I/flutter (14966): convert end I/flutter (14966): ----------------------------------------
the aac file is the temp file, and the mp3 is the result of convert, the file is successfuly converted and it appear in the path where it would be. i don’t know if this line "D/flutter-ffmpeg(14966): Running FFmpeg with arguments: [-loglevel, error, -y, -i, " mean something important or not cause this error text.
But on release this convert make the app crash.
Below screenshot of my full code to save the record
Issue Analytics
- State:
- Created 2 years ago
- Comments:52
Top GitHub Comments
Hi Necro,
Flutter Sound 8.1.9 is released. This version has a fix for your issue.
You must also check your build.gradle :
jcenter()
mavenCentral()
if not already doneI wrote a very simple example here that record an AAC audio, convert it to MP3 and playback it. You probably do not need any more this example : your code was correct and the problem was on Flutter FFmpeg.
Thank you for your patience
Might be better off using flutter sound lite and including ffmpeg as a separate dependency and running the commands directly.
Flutter_ffmpeg likes to crash or output weird things when multiple jobs are run concurrently. I had to create a queue system for ffmpeg calls to work around this. I’m sure there are other quirks and something like that could be causing this issue.
Best way forward is probably to run ffmpeg directly so you have full control over the process