question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Media] Taking a video on Marshmallow(6.0.1) always returns null.

See original GitHub issue

From @swansca79 on May 10, 2016 13:0

Please take a moment to fill out the following (change to preview to check or place x in []):

This is a

  • Bug
  • Feature Request

Which plugin does this impact:

  • Battery
  • Connectivity
  • Contacts
  • DeviceInfo
  • ExternalMaps
  • Geolocator
  • Media
  • Permissions
  • Settings
  • Text To Speech
  • Vibrate
  • Other:

Version Number of Plugin: 2.3.0 Device Tested On: Nexus 6P 6.0.1 w/ April Security patches Simulator Tested On:

Expected Behavior

Taking a video should return a MediaFile result.

Actual Behavior

Always returns null.

Steps to reproduce the Behavior

When this was originally implemented it worked, and all I can say for sure was that it was before the April security patches on my Nexus 6P. This bug does not happen on pre-marshmallow devices.

  1. New forms project 2.2.0.31 (also happens on 2.1.0.6529)
  2. Add media plugin
  3. Run this code
async void MakeNewVideo(){
  IMedia media = CrossMedia.Current;
  await media.Initialize ();
  if (media.IsTakeVideoSupported) {
    MediaFile result = await media.TakeVideoAsync (new StoreVideoOptions (){ Quality= VideoQuality.Medium });
     if (result != null) {
        VideoPathLabel.Text += result.Path;
      } 
  } 
}

Copied from original issue: jamesmontemagno/Xamarin.Plugins#297

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:36 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
jamesmontemagnocommented, Jan 31, 2018

Will need someone to debug the source code as of the 5 android devices I have none of them have 6.0.1 on them.

0reactions
BryanSancommented, Jun 23, 2019

There is some issue when you use the FileProvider with this plugin in Android versions lower than 7.0. The URL that is created is not working, it seems that there is some permissions issue. I have two physical phones (Samsung S4 and Samsung Galaxy Prime, both Lollipop 5.0 and 5.1) that were not working due to this problem. I tried to fix the permissions issue to use the FileProvider but I couldn’t so I fix it avoiding the FileProvider at all in Android Versions lower than 7.0. Now I have both phones working without side effects!

Unfortunately, you have to touch the source code to get the fix.

Use this code

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

MediaCodec returns null for getOutputImage on real devices
I'm trying to grab the Image of a Video via the MediaCodec using the getOutputImage method (Framework used: Exoplayer). I'm NOT using a ......
Read more >
How to change camera importer setting from always to just ...
I selected camera importer, but now everytime I connect the Canon camera it automatically opens camera importer. How do I stop this and...
Read more >
OPO Android 6.0.1 boot fail - HELP?!
Hi.I've just updated to android 6.0.1 (the CyanogenMod version ofc.) last night via the OTA.And after it had updated, and was done with...
Read more >
Android 6.0 APIs
Android 6.0 (M) offers new features for users and app developers. This document provides an introduction to the most notable APIs.
Read more >
[Bug] Null results with Voice Recognition Service on Google ...
The voice recognition service for android from the Google Quick ... are using SpeechRecognizer and onResults method is always return "null".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found