-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MediaCapture CaptureVideo immediately closing app on Android 11 #227
Comments
@sampalm Hello, I'm actually encountering / attempting to patch this same issue in my app. Please see - #215 It appears the issue is the plugin storing the video in non-local storage location, and then Android 11 doesn't allow the webview to access that data. Our fix for now, is to fork this code from pull #215 (here : https://github.com/chriskhongqarma/cordova-plugin-media-capture ) and install from there. We're just building / testing this now. There's some comments on #215 that it is slated to maybe go in with v4.0.0 of this plugin, which is waiting on cordova-android 10.0.0 which just got released last week, I think. ( https://github.com/apache/cordova-android/blob/master/RELEASENOTES.md ) Lemme know if that helps, have any other questions. |
Thank you very much @PabbleDabble, you just saved my day haha |
I'm getting the same error while recording Audio.
I tried #215, it works without crashing. ionic3, |
When? On the 3.0.3 version of cordova-plugin-media-capture? That would make sense to me as Android 11 has changed the file securities. That's what #215 was meant to fix for audio/video/image (I think, we only use it for video but looking at the PR it looks like the user made a method to use absolute path - which works with Android 11)
That sounds like a different plugin, and I would suggest seeing if they have an update for that. We've experienced broken file/system path issues for Android 11 (or even just targeting SDK-30) for 4 different plugins now. SDK-30 (Android 11) will HAVE to be targeted for existing app come November 2021. Good luck. |
@PabbleDabble I'm using the latest(3.0.3) version of cordova-plugin-media-capture . |
@viktor-shmigol I'm very sorry for not responding, I must have missed this. We don't use cordova-plugin-media-capture for audio capture as it had some other issues for us related to Window/iOS/Android consistency. We're using - https://github.com/apache/cordova-plugin-media - for all our audio. I would look in the code for cordova-plugin-media-capture in the audio section and see if the changes for #215 need to be also applied to that section as well? I would not be surprised if the user who made that maybe cares more about the video capture and targeted that, and didn't bother to update the audio part? We support audio capture in our app but honestly I don't know who that's useful for as (in my opinion) voice notes are kind of weird way for users to want to capture data. |
Thank you @PabbleDabble ! |
Strange but I got this app crash too for device Android 11/12 but also Android 9 (app built with API 29 and API 30) failing:
recorded content seems to be "inside" dirs of these recorder apps and media-capture can not access it fine:
recorded content is located in "public" audio dir and media-capture can access it I am going to create a PR to prevent this NPE caused app crash - while #215 to use FileProvider is a more future proof rework for sure |
Issue Type
Description
Information
I'm working on a project using Ionic 3,x and Angular2. We're trying to use media-capture to record videos and it seems to work fine on any tablet with Android below 11, when we try to record a video using a Galaxy Tab A7 SM-T505 with an Android version 11 last updated at 1st February 2021 the app closes immediately logging out that error:
I'm pointing out that that error only occurs with that tablet on that android version in particular.
Command or Code
this.mediaCapture.captureVideo(this.videoOptions).then((mediafile: MediaFile[]) => { console.log('result ', mediafile); });
Environment, Platform, Device
Version information
Cordova CLI, Ionic framework, Android Studio
Checklist
The text was updated successfully, but these errors were encountered: