Open Ccastillo06 opened 4 years ago
Hi, @Ccastillo06
Can you check if you have similar issues when using example project from this repository? If yes, then check the Console output for iPhone device/simulator. That may help a lot. App crashing immediately disconnects from debugger - that is the reason for Lost connection to device message.
I just tested the example contained in the repo and tried replicating in a new project again. It works for iPhone as far as the audio file is not in AWS.
In the example, the audio file is in Github and it loads nice, but the moment I load an AWS url using any .mp3 file, it keeps working fine for Android but no for iOS. I tried storing the audio file in a public AWS S3 Bucket and still have the problem.
I also tried using flutter run --verbose
and these are the logs related to the error I had:
[+3177 ms] Service protocol connection closed.
[ ] Lost connection to device.
No more info related to the error. I'm sorry I can't provide more data than this, but flutter is not giving more information.
You should try to open the iOS subproject in Xcode, run it and check what would be printed there. I hope you'd find something useful in the crashlog. Also I was told that since iOS 9 all the network connections have to be done over secure protocols like HTTPS. Please, check your url if it uses HTTPS and not HTTP.
Hardware Model: iPhone10,4 Process: Runner [5005] AppVariant: 1:iPhone10,4:13 Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd [1] Date/Time: 2020-06-11 10:22:14.1048 -0500 Launch Time: 2020-06-11 10:21:17.6765 -0500 OS Version: iPhone OS 13.5.1 (17F80) Release Type: User Baseband Version: 3.05.00 Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x000000002b8a9b40
VM Region Info: 0x2b8a9b40 is not in any region. Bytes before following region: 3608782016
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 0000000102a44000-0000000102a4c000 [ 32K] r-x/r-x SM=COW ...er.app/Runner
Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler [5005] Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libobjc.A.dylib 0x000000018cc0a980 objcretain + 16 (objc-object.h:459)
1 soundpool 0x0000000104565594 specialized SwiftSoundpoolPlugin.SoundpoolWrapper.handle(:result:) + 6924 (SwiftSoundpoolPlugin.swift:111)
2 soundpool 0x0000000104566efc specialized SwiftSoundpoolPlugin.handle(:result:) + 2420 (
@nezoat Can you answer following questions?
It doesn't happen every time it. It's crashed 7 times, affecting 3 out of about 20 test users so a fairly high crash rate.
Plugin version 1.1.1
I can't reproduce the crash, but this is the code that is used (unrelated things removed):
if (_audioPlayer == null) { _audioPlayer = Soundpool(streamType: StreamType.notification); } final data = await rootBundle.load("assets/sounds/$soundName.mp4"); if (preloadOnly) { soundId = await _audioPlayer.load(data); } else { soundId = await _audioPlayer.loadAndPlay(data); }
I have same problem, no any error message, just crash。plugin version 1.1.1 the play code is:
asset = await rootBundle.load("assets/audio/alarm1.mp3");
_alarmSound = await _soundpool.load(asset);
_alarmSoundStreamId = await _soundpool.play(_alarmSound);
the stop code is :
if(_alarmSoundStreamId!=null){
await _soundpool.stop(_alarmSoundStreamId);
_alarmSoundStreamId = null;
}
@nezoat I think this may be caused because you are using wrong soundId
s. It seems there was no audio registered with the soundId
OR soundId
returned from load()
was an error value of -1
. I see the documentation is not clear enough about that -1
from load
indicates error.
Hello,
I've been using the package in my Android app with no issues, but we are now developing the iOS version and adapting the Flutter code to work in both OS.
The issue I found is that the app literally crashes and just shows the next message whenever we play audio: Lost connection to device
I tried recreating the issue in a new Flutter project and it happens too whenever I play audio from an url using
pool.loadAndPlayUri(uri);
where uri is a valid string and plays properly in Android.I opened the issue just to communicate the problem and ask if there is some special permission needed in iOS to play the audio from url using this package. We are using a physical iPhone 6 and the software version is 12.4.5. Happens also when running the iOS simulator with an iPhone 11.
Thanks in advance!