Reputation: 131
I am trying to run the just_audio sample project from its own repository https://github.com/ryanheise/just_audio/tree/master/just_audio/example
It is working fine on android but when I clone the project using a mac and run it on the simulator it throws this error :
[VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: (-11800) The operation could not be completed
#0 AudioPlayer._load (package:just_audio/just_audio.dart:778:9)
<asynchronous suspension>
#1 AudioPlayer._setPlatformActive.<anonymous closure> (package:just_audio/just_audio.dart:1346:28)
<asynchronous suspension>
And this error pops up while I'm trying to call the audio URL for streaming using setUrl() method
I have also tried Editing Transport security as the documentation recommends
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsForMedia</key>
<true/>
</dict>
Note
I have tried all the other packages available for ios for playing and streaming audio and none of them worked
Upvotes: 13
Views: 7950
Reputation: 982
how can we handle [GETX] Info: _GetImpl Instance of '_GetImpl' runZonedGuarded: PlatformException(-11800, The operation could not be completed, {index: 0}, null) this in app? , i have music app , where I download and play songs , but when I update the app , this downloaded path exists but doest not work. is there any way I can handle this issue?
flutter: setMediaItemInQueue called playFromMediaId title isdownload path : Clap Your Hands true /var/mobile/Containers/Data/Application/E0A30141-D87A-4960-827F-A2C76E6DAD0E/Documents/download/dccd547ede95829b98af67adc8af1ec9.mp3 [GETX] Instance "MusicTrayController" with tag "MusicTrayController" has been initialized flutter: MusicTrayController onInit flutter: musicBottomSheetOption isDownload true [GETX] Info: _GetImpl Instance of '_GetImpl' runZonedGuarded: PlatformException(-11800, The operation could not be completed, {index: 1}, null)
Upvotes: 0
Reputation: 244
I'm answering here in case anyone has the same issue. In my case :
=> to eventually debug this case if every other answers don't work :
Try to do the very simple test to know if the file you want to load does exist (with File().existsSync() )
Upvotes: 1
Reputation: 61
If you are using AudioEncoder.aacLc, then don't use 'aac' extension, but use 'm4a'.
Upvotes: 0
Reputation: 609
For me, the error was that I had configured bitRate equal to 25600
, when I changed it to 32000
, it worked correctly.
record.start(
path: 'pathTo/file/audio.m4a',
encoder: AudioEncoder.aacLc,
bitRate: 25600, // <-- Error
samplingRate: 44100,
numChannels: 1,
);
record.start(
path: 'pathTo/file/audio.m4a',
encoder: AudioEncoder.aacLc,
bitRate: 32000, // Works!
samplingRate: 44100,
numChannels: 1,
);
It also worked with 64000
and 128000
.
Upvotes: 0
Reputation: 59406
In my case, I restarted the IOS simulator and it worked perfectly.
Upvotes: 7
Reputation: 819
You might need to test just_audio
on a real iOS device.
It seems like the exception only gets thrown on a Simulator. 🤔
Also, don't forget to allow arbitrary loads as shown here by Reham 🙌🏽
Upvotes: 2
Reputation: 159
If you wish to connect to non-HTTPS URLS, add the following to your Info.plist file:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsForMedia</key>
<true/>
</dict>
Upvotes: 3