Open mayankkataria opened 3 years ago
Facing same issue for android 10+ SDK 30. As per doc error:1 refers to MediaError.MEDIA_ERR_ABORTED = 1
Same on iOS 14 with Ionic Capacitor:
Log just says: Media create INVALID Media startRecordingAudio INVALID Media stopRecordingAudio INVALID
Couldn't catch any other log from exceptions nor catching error promises, so I don't know how to proceed.
Hi guys not sure if this might help the android guys but worked for me
Go into the android project AndroidManifest.xml
file.
Place the following tag: android:requestLegacyExternalStorage="true"
Like so inside the application tag:
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
android:requestLegacyExternalStorage="true">
Same situation here. Can't find any more information.
same..
This solution with the "requestLegacyExternalStorage" is soon going to be an issue.
https://developer.android.com/about/versions/11/privacy/storage
If I understand correctly, our apps won't be able to write to the external directory so easily anymore...
Same issue here in Android API 30.
Any workaround to fix it?
android:requestLegacyExternalStorage="true"
not work for me.
Thanks!
Same issue here in Android API 30.
Any workaround to fix it?
android:requestLegacyExternalStorage="true"
not work for me.Thanks!
Did you find any solution ??
Same issue here in Android API 30. Any workaround to fix it?
android:requestLegacyExternalStorage="true"
not work for me. Thanks!Did you find any solution ??
In my case my app required this feature, so I ended up developing my app with Flutter. You can make yourself an idea on how many time I spent trying to solve this particular problem.
I also don't have any solution unfortunately... I cannot update my Android app right now.
for android instead of this.file.externalRootDirectory try this.file.externalDataDirectory. it works for me. For android and iOS this directory works for me this.global.G_ExternalDirectory = this.platform.is('ios') ? this.file.dataDirectory : this.file.externalDataDirectory;
in addition to it, before audio recording I am checking audio and storage access permission explicitly.
this.diagnostic.requestMicrophoneAuthorization() and this.diagnostic.requestExternalStorageAuthorization()
see if that works for you too.
In my case my app required this feature, so I ended up developing my app with Flutter. You can make yourself an idea on how many time I spent trying to solve this particular problem.
Nothing works for me.. I Have an app builder, In which 20K apps that depends on this plugin (required this feature)- I don't required to record and play. We use live stream e.g (-[(http://streams.radiobob.de/bob-chillout/aac-64/streams.radiobob.de/)]) and just want to play this audio stream on button click.. When I click play button, output is: Error: 1
@zubinraja Thanks for you solution but not working for me. Still figure out . @21pg agreed.
I'm using this plugin with ionic capacitor instead of cordova with command
ionic cap sync
. My code:When I clicked record, output was:
Error: 1
and when I stopped recording than the output wasstatus: 4
andAction is successful
I expected to either play the recording or getaudiofile.mp3
in file manager of my android device but I didn't got any of it.