Canardoux / flutter_sound

Flutter plugin for sound. Audio recorder and player.
Mozilla Public License 2.0
876 stars 569 forks source link

[BUG]: Android Emulator - Trying to play Mp3 file. UI is not responsive. Error: failed to attach to thread 1688: Permission denied #770

Open CherukuriSiva opened 3 years ago

CherukuriSiva commented 3 years ago

Flutter Sound Version :

flutter_sound_lite: ^8.3.12

Dart SDK 2.14.0 Flutter SDK 2.5.0 expo_eye 1.0.0+1 |-- cached_network_image 3.1.0 | |-- cached_network_image_platform_interface 1.0.0 | | |-- flutter... | | '-- flutter_cache_manager... | |-- cached_network_image_web 1.0.1 | | |-- cached_network_image_platform_interface... | | |-- flutter... | | '-- flutter_cache_manager... | |-- flutter... | |-- flutter_cache_manager 3.1.2 | | |-- clock... | | |-- collection... | | |-- file 6.1.2 | | | |-- meta... | | | '-- path... | | |-- flutter... | | |-- http... | | |-- path... | | |-- path_provider... | | |-- pedantic 1.11.1 | | |-- rxdart 0.27.2 | | |-- sqflite 2.0.0+4 | | | |-- flutter... | | | |-- path... | | | '-- sqflite_common 2.0.1+1 | | | |-- meta... | | | |-- path... | | | '-- synchronized... | | '-- uuid... | '-- octo_image 1.0.0+1 | |-- flutter... | '-- flutter_blurhash 0.6.0 | |-- flutter... | |-- meta... | '-- pedantic... |-- carousel_slider 4.0.0 | '-- flutter... |-- cupertino_icons 1.0.3 |-- dio 4.0.0 | |-- http_parser 4.0.0 | | |-- charcode... | | |-- collection... | | |-- source_span... | | |-- string_scanner... | | '-- typed_data... | '-- path 1.8.0 |-- flutter 0.0.0 | |-- characters 1.1.0 | |-- collection 1.15.0 | |-- meta 1.7.0 | |-- sky_engine 0.0.99 | |-- typed_data 1.3.0 | | '-- collection... | '-- vector_math 2.1.0 |-- flutter_lints 1.0.4 | '-- lints 1.0.1 |-- flutter_sound_lite 8.3.12 | |-- flutter... | |-- flutter_sound_platform_interface 8.3.12 | | |-- flutter... | | |-- logger... | | |-- meta... | | '-- plugin_platform_interface... | |-- flutter_sound_web 8.3.12 | | |-- flutter... | | |-- flutter_sound_platform_interface... | | |-- flutter_web_plugins... | | |-- js 0.6.3 | | |-- logger... | | '-- meta... | |-- logger 1.1.0 | |-- path... | |-- path_provider 2.0.4 | | |-- flutter... | | |-- path_provider_linux 2.1.0 | | | |-- flutter... | | | |-- path... | | | |-- path_provider_platform_interface... | | | '-- xdg_directories 0.2.0 | | | |-- meta... | | | |-- path... | | | '-- process 4.2.3 | | | |-- file... | | | |-- path... | | | '-- platform... | | |-- path_provider_macos 2.0.2 | | | '-- flutter... | | |-- path_provider_platform_interface 2.0.1 | | | |-- flutter... | | | |-- meta... | | | |-- platform 3.0.2 | | | '-- plugin_platform_interface... | | '-- path_provider_windows 2.0.3 | | |-- ffi 1.1.2 | | |-- flutter... | | |-- meta... | | |-- path... | | |-- path_provider_platform_interface... | | '-- win32 2.2.9 | | '-- ffi... | |-- provider 6.0.0 | | |-- collection... | | |-- flutter... | | '-- nested 1.0.0 | | '-- flutter... | |-- recase 4.0.0 | |-- synchronized 3.0.0 | '-- uuid 3.0.4 | '-- crypto 3.0.1 | |-- collection... | '-- typed_data... |-- flutter_svg 0.22.0 | |-- flutter... | |-- meta... | |-- path_drawing 0.5.1 | | |-- flutter... | | |-- meta... | | |-- path_parsing 0.2.1 | | | |-- meta... | | | '-- vector_math... | | '-- vector_math... | |-- vector_math... | '-- xml 5.3.0 | |-- collection... | |-- meta... | '-- petitparser 4.3.0 | '-- meta... |-- flutter_test 0.0.0 | |-- async 2.8.1 | | |-- collection... | | '-- meta... | |-- boolean_selector 2.1.0 | | |-- source_span... | | '-- string_scanner... | |-- characters... | |-- charcode 1.3.1 | |-- clock... | |-- collection... | |-- fake_async 1.2.0 | | |-- clock... | | '-- collection... | |-- flutter... | |-- matcher 0.12.10 | | '-- stack_trace... | |-- meta... | |-- path... | |-- source_span 1.8.1 | | |-- collection... | | |-- path... | | '-- term_glyph... | |-- stack_trace 1.10.0 | | '-- path... | |-- stream_channel 2.1.0 | | '-- async... | |-- string_scanner 1.1.0 | | |-- charcode... | | '-- source_span... | |-- term_glyph 1.2.0 | |-- test_api 0.4.2 | | |-- async... | | |-- boolean_selector... | | |-- collection... | | |-- matcher... | | |-- meta... | | |-- source_span... | | |-- stack_trace... | | |-- stream_channel... | | |-- string_scanner... | | '-- term_glyph... | |-- typed_data... | '-- vector_math... |-- image_picker 0.8.4+1 | |-- flutter... | |-- flutter_plugin_android_lifecycle 2.0.3 | | '-- flutter... | |-- image_picker_for_web 2.1.3 | | |-- flutter... | | |-- flutter_web_plugins... | | |-- image_picker_platform_interface... | | '-- meta... | '-- image_picker_platform_interface 2.4.1 | |-- cross_file 0.3.1+5 | | |-- flutter... | | '-- meta... | |-- flutter... | |-- http 0.13.3 | | |-- async... | | |-- http_parser... | | |-- meta... | | |-- path... | | '-- pedantic... | |-- meta... | '-- plugin_platform_interface 2.0.1 | '-- meta... |-- intl 0.17.0 | |-- clock 1.1.0 | '-- path... |-- nb_utils 4.4.8 | |-- connectivity_plus 1.1.0 | | |-- connectivity_plus_linux 1.1.0 | | | |-- connectivity_plus_platform_interface... | | | |-- dbus 0.5.6 | | | | |-- args 2.3.0 | | | | |-- ffi... | | | | |-- meta... | | | | |-- pedantic... | | | | '-- xml... | | | |-- flutter... | | | |-- meta... | | | '-- nm 0.3.0 | | | '-- dbus... | | |-- connectivity_plus_macos 1.1.0 | | | |-- connectivity_plus_platform_interface... | | | '-- flutter... | | |-- connectivity_plus_platform_interface 1.1.0 | | | |-- flutter... | | | |-- meta... | | | '-- plugin_platform_interface... | | |-- connectivity_plus_web 1.1.0+1 | | | |-- connectivity_plus_platform_interface... | | | |-- flutter... | | | '-- flutter_web_plugins... | | |-- connectivity_plus_windows 1.1.0 | | | |-- connectivity_plus_platform_interface... | | | '-- flutter... | | |-- flutter... | | '-- meta... | |-- flutter... | |-- fluttertoast 8.0.8 | | |-- flutter... | | '-- flutter_web_plugins 0.0.0 | | |-- characters... | | |-- collection... | | |-- flutter... | | |-- js... | | |-- meta... | | |-- typed_data... | | '-- vector_math... | '-- shared_preferences 2.0.7 | |-- flutter... | |-- meta... | |-- shared_preferences_linux 2.0.2 | | |-- file... | | |-- flutter... | | |-- meta... | | |-- path... | | |-- path_provider_linux... | | '-- shared_preferences_platform_interface... | |-- shared_preferences_macos 2.0.2 | | |-- flutter... | | '-- shared_preferences_platform_interface... | |-- shared_preferences_platform_interface 2.0.0 | | '-- flutter... | |-- shared_preferences_web 2.0.2 | | |-- flutter... | | |-- flutter_web_plugins... | | |-- meta... | | '-- shared_preferences_platform_interface... | '-- shared_preferences_windows 2.0.2 | |-- file... | |-- flutter... | |-- meta... | |-- path... | |-- path_provider_platform_interface... | |-- path_provider_windows... | '-- shared_preferences_platform_interface... |-- permission_handler 8.1.6 | |-- flutter... | |-- meta... | '-- permission_handler_platform_interface 3.6.1 | |-- flutter... | |-- meta... | '-- plugin_platform_interface... '-- video_player 2.2.3 |-- flutter... |-- meta... |-- video_player_platform_interface 4.2.0 | |-- flutter... | |-- flutter_test... | '-- meta... '-- video_player_web 2.0.4 |-- flutter... |-- flutter_web_plugins... |-- meta... '-- video_player_platform_interface...

Platforms you faced the error

Describe the bug I am trying to play the mp3 file. Onclick of play app got stuck and not responsive. Here is my code:

`import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_sound_lite/flutter_sound.dart';

const exampleAudioFilePathMP3 = "https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3";

class TestAudio2 extends StatefulWidget { const TestAudio2({Key? key}) : super(key: key);

@override _TestAudio2State createState() => _TestAudio2State(); }

class _TestAudio2State extends State { FlutterSoundPlayer _myPlayer = FlutterSoundPlayer(); bool _mPlayerIsInited = false;

@override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: Container( height: 150.0, child: Row( children: [ IconButton( icon: const Icon(Icons.play_arrow_rounded), onPressed: _onPressedPlay, ), ], )), ); }

@override void initState() { _myPlayer.openAudioSession().then((value) { setState(() { _mPlayerIsInited = true; }); }); super.initState(); }

@override void dispose() { _myPlayer.closeAudioSession(); // _myPlayer = null; super.dispose(); }

_onPressedPlay() async { String outputFile = exampleAudioFilePathMP3; if (_mPlayerIsInited) { await _myPlayer.startPlayer( fromURI: outputFile, codec: Codec.mp3, numChannels: 1, whenFinished: () { setState(() {}); }, ); } } } `

Below are the logs I/lat.ae.expo_ey(15526): Thread[7,tid=15543,WaitingInMainSignalCatcherLoop,Thread*=0xe5a62400,peer=0x12e00d60,"Signal Catcher"]: reacting to signal 3 I/lat.ae.expo_ey(15526): I/lat.ae.expo_ey(15526): Wrote stack traces to tombstoned F/crash_dump32(15824): crash_dump.cpp:460] failed to attach to thread 1688: Permission denied

github-actions[bot] commented 10 months ago

This issue is stale because it has been open 90 days with no activity. Leave a comment or this will be closed in 7 days.