Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Camera will not work on Android 10.0 after update. #1884

Open
dsklack opened this issue Sep 16, 2021 · 8 comments
Open

Camera will not work on Android 10.0 after update. #1884

dsklack opened this issue Sep 16, 2021 · 8 comments

Comments

@dsklack
Copy link

dsklack commented Sep 16, 2021

Bug report best practices: Submitting Issues

Description

I have a large App that was running at Xamarin Forms 4.0 and Android 9.0. I updated the software to Forms 5.0.0.2083 and Android 10.0 and the Capture_Image quit. I created a small App with only the camera setup, but get the same results. I have tried both MediaPicker.CapturePhotoAsync and CrossMedia.Current.TakePhotoASync. I have looked over the different forums and tried what is listed, but can not find a solution.

Steps to Reproduce

  1. See attached zip file with App

Expected Behavior

When the Take button is clicked, Camera should open to allow for picture to be taken.

Actual Behavior

If using Crossmedia, get this error:
"No Activity found to handle Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3 clip={text/uri-list U:content://com.companyname.app1.fileprovider/my_images/IMG_20210916_104748.jpg} (has extras) }"

if using MediaPicker, get this error:
"Either there was no camera on the device or 'android.media.action.IMAGE_CAPTURE' was not added to the element in the app's manifest file. See more: https://developer.android.com/about/versions/11/privacy/package-visibility"

Basic Information

VS 2019 Ver 16.11.2

  • Android: <Android 10.0 - API 29
  • Nuget Packages:

image

  • Affected Devices:
    Samsung SM-T387V

Screenshots

Reproduction Link

App1.zip

@dsklack
Copy link
Author

dsklack commented Sep 24, 2021

I have 2 identical Samsung SM-T387V with the same update history, one gets the error and the other work as it is supposed to.

@roynesbitt
Copy link

I had the same issue on a phone with android 11.0, I added the following lines to AndroidManifest.xml which seems to have resolved the issue (please note the single quotes should be removed as they are there to allow the xml to be displayed):
<queries'>
<intent'>
<action android:name="android.media.action.VIDEO_CAPTURE" '/>
</intent'>
<intent'>
<action android:name="android.media.action.IMAGE_CAPTURE" '/>
</intent'>
</queries'>

@dsklack
Copy link
Author

dsklack commented Sep 27, 2021

I have tried that, but still have one unit that works and one that errors out.

@dsklack
Copy link
Author

dsklack commented Oct 6, 2021

Here is an interesting discovery. The tablet that would not use the camera before, I did a Factory reset on. Then I loaded Applications that use the camera. They all work now. This tells me the problem is in the Android OS or some update/permission change. Has anyone else observed this?

@raj-doshi
Copy link

Is there any update on this? Is it going to be resolved soon? I have tried many solutions but none of them are working. It seems issue is not from library but if someone has any solution, let me know.

@Genfood
Copy link

Genfood commented Nov 7, 2021

Well this worked for me. But pay attention, there is a ' at the end ;)

For copy pasta:

<queries>
    <intent>
        <action android:name="android.media.action.IMAGE_CAPTURE" />
    </intent>
</queries>

You also may need to reinstall the application.

I had the same issue on a phone with android 11.0, I added the following lines to AndroidManifest.xml which seems to have resolved the issue (please note the single quotes should be removed as they are there to allow the xml to be displayed): <queries'> <intent'> <action android:name="android.media.action.VIDEO_CAPTURE" '/> </intent'> <intent'> <action android:name="android.media.action.IMAGE_CAPTURE" '/> </intent'> </queries'>

@sanz777
Copy link

sanz777 commented Nov 26, 2021

@Genfood Thanx Solved For Me

@codermonk1
Copy link

Well this worked for me. But pay attention, there is a ' at the end ;)

For copy pasta:

<queries>
    <intent>
        <action android:name="android.media.action.IMAGE_CAPTURE" />
    </intent>
</queries>

You also may need to reinstall the application.

I had the same issue on a phone with android 11.0, I added the following lines to AndroidManifest.xml which seems to have resolved the issue (please note the single quotes should be removed as they are there to allow the xml to be displayed): <queries'> <intent'> <action android:name="android.media.action.VIDEO_CAPTURE" '/> </intent'> <intent'> <action android:name="android.media.action.IMAGE_CAPTURE" '/> </intent'> </queries'>

Still not working in my app
have any Solution

thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants