[Camera Plugin] It's not working on Android 8.1

[Camera Plugin] It's not working on Android 8.1

  
Forge Component
(11)
Published on 26 Sep by OutSystems R&D
11 votes
Published on 26 Sep by OutSystems R&D

Hi,

 I used the camera plugin on my application but it's not working on android 8.1. When I tryed to take a picture the aplication stops. Its only happening on Android 8.1

The camera plugin is not compatible whit this Android version?

Hi Jenifer,

Can you make sure your application has the camera access?

If your application doesn't have access to the camera in the device then the application usually crashes.

Hello, Jenifer,

I was able to use it on my Android 8.1 device, so there may be something we're missing here.

Could please open a support case with us so we can analyse the issue and find a solution?

Thanks in advance and best regards,

Carlos Simões

Our case: At any moment of instalation process the info ("warning") related to "access camera" didn't show.


And now, to ALL devices with Android 8.0+ trigger security access violation and app crash.

We open a support case to OS.

Error:


Motorola Moto G (5th Gen) (cedric), Android 8.1

java.lang.RuntimeException:

  at android.app.ActivityThread.deliverResults (ActivityThread.java:4382)
  at android.app.ActivityThread.handleSendResult (ActivityThread.java:4426)
  at android.app.ActivityThread.-wrap20 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1685)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:164)
  at android.app.ActivityThread.main (ActivityThread.java:6626)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:438)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:811)

Caused by: java.lang.SecurityException:
  at android.os.Parcel.readException (Parcel.java:2005)
  at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:183)
  at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:135)
  at android.content.ContentProviderProxy.delete (ContentProviderNative.java:547)
  at android.content.ContentResolver.delete (ContentResolver.java:1636)
  at org.apache.cordova.camera.CameraLauncher.checkForDuplicateImage (CameraLauncher.java:1242)
  at org.apache.cordova.camera.CameraLauncher.processResultFromCamera (CameraLauncher.java:546)
  at org.apache.cordova.camera.CameraLauncher.onActivityResult (CameraLauncher.java:820)
  at org.apache.cordova.CordovaInterfaceImpl.onActivityResult (CordovaInterfaceImpl.java:152)
  at org.apache.cordova.CordovaActivity.onActivityResult (CordovaActivity.java:358)
  at android.app.Activity.dispatchActivityResult (Activity.java:7305)
  at android.app.ActivityThread.deliverResults (ActivityThread.java:4378)


Samsung Galaxy J8 (j8y18lte), Android 8.0

java.lang.RuntimeException:
  at android.app.ActivityThread.deliverResults (ActivityThread.java:4491)
  at android.app.ActivityThread.handleSendResult (ActivityThread.java:4534)
  at android.app.ActivityThread.-wrap20 (Unknown Source)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1752)
  at android.os.Handler.dispatchMessage (Handler.java:105)
  at android.os.Looper.loop (Looper.java:164)
  at android.app.ActivityThread.main (ActivityThread.java:6944)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)
 

Caused by: java.lang.SecurityException:
  at android.os.Parcel.readException (Parcel.java:1959)
  at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:183)
  at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:135)
  at android.content.ContentProviderProxy.delete (ContentProviderNative.java:547)
  at android.content.ContentResolver.delete (ContentResolver.java:1642)
  at org.apache.cordova.camera.CameraLauncher.checkForDuplicateImage (CameraLauncher.java:1242)
  at org.apache.cordova.camera.CameraLauncher.processResultFromCamera (CameraLauncher.java:546)
  at org.apache.cordova.camera.CameraLauncher.onActivityResult (CameraLauncher.java:820)
  at org.apache.cordova.CordovaInterfaceImpl.onActivityResult (CordovaInterfaceImpl.java:152)
  at org.apache.cordova.CordovaActivity.onActivityResult (CordovaActivity.java:358)
  at android.app.Activity.dispatchActivityResult (Activity.java:7556)
  at android.app.ActivityThread.deliverResults (ActivityThread.java:4487)

Solution

Updating... OS support oficially return info where found missing permissions about this and fixing it to next version.

Solution

Maycon Oleczinski wrote:

Updating... OS support oficially return info where found missing permissions about this and fixing it to next version.

Thank you very much for the reply! I was lost on this issue


Thank you all for the reply's ! waiting for the next version...

Hi All.


The new version has been delivered 4.0.0.

Althrough status "Under Develpment" it can be downloaded, implemented and tested. I did this.

OS Support is awaiting my feedback.
We generate and redistribute, and now we're also awaiting feedback from end users. Because don't have devices with Android 8.0+ at this moment.
If anyone can be testing and reporting, we will be very grateful.

Maycon Oleczinski wrote:

Hi All.


The new version has been delivered 4.0.0.

Althrough status "Under Develpment" it can be downloaded, implemented and tested. I did this.

OS Support is awaiting my feedback.
We generate and redistribute, and now we're also awaiting feedback from end users. Because don't have devices with Android 8.0+ at this moment.
If anyone can be testing and reporting, we will be very grateful.

HI

I tested on Motorola Moto G5 (Android 8.1) and it's working now!


Great!
Tnx'o'mch for quickly reply.

I also hit issues (Phone LG V30 Android 8.0) - as described in the original email. Permissions error. I updated the Camera Plugin to V4.0 - as recommended and have run a successful test - no crashes. Your fix appears to work from my perspective. Test run on OS V11.

OnPlus 6 : Android 9.. not working on V11 :-(