NativeScript / nativescript-camera

NativeScript plugin to empower using device camera.
Apache License 2.0
92 stars 47 forks source link

Camera not opening on android 11 #252

Closed AnthonyLenglet closed 2 years ago

AnthonyLenglet commented 3 years ago

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

Whenever we try to take a picture, the camera never pops up, and no error is given in the console

Is there any code involved?

    try {
      await requestPermissions();
      const imageAsset = await takePicture({
        width: 100,
        height: 100,
        allowsEditing: true,
        keepAspectRatio: true,
      });
      return imageAsset;
    } catch (err) {
      this.alertRefusedPermissions({
        title: "Accès à l'appareil photo refusé",
        message:
          "l'accès à l'appareil photo a été refusé, veuillez l'activer via la page paramètres afin de l'utiliser",
      });
      throw 'Permissions refused';
    }
jcassidyav commented 3 years ago

I am seeing the same thing, it does not work for me unless I use nativescript@6.7.4 to build anything higher and I see this behavior.

jcassidyav commented 3 years ago

For me it was down to tarketSDK, newer cli defaulting it to 30, changing it to 29 in settings.json and it now works.

kourtzaridisr88 commented 3 years ago

Same issue here

DanielDent commented 3 years ago

I believe the issue is that the plugin is currently only compatible with API level 28. At API level 29, adding android:requestLegacyExternalStorage="true" to the app manifest is available as a workaround, but this option is no longer available at API level 30.

IhaveQs commented 3 years ago

I am experiencing the same problem.

Phone: Google Pixel (3a &4XL) Android version: 11 tns-android: 6.5.3 nativescript/core: 6.5.12 nativescript-camera: 4.5.0

This problem did not exist with Android 10 or with any other brand of phone (only Google Phones)

itsmerockingagain commented 3 years ago

Hi All, Can anyone provide a solution for this issue in android 11? seems like NS is not supporting latest OS android 11 on NS6

AdrianoOP commented 2 years ago

Same thing here... Any update?

vicmasa commented 2 years ago

Same thing here... Any update?

AnthonyLenglet commented 2 years ago

I haven't personally touched the project in a bit, but we're not getting any issues on our end anymore since having updated everything to "@nativescript/camera": "^5.0.6" and "@nativescript/core": "~8.1.1"

since this no longer seems to be a problem on the newer version, I will close this issue