You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Lerolben (via GitHub)" <gi...@apache.org> on 2023/09/29 13:26:50 UTC

[GitHub] [cordova-plugin-camera] Lerolben opened a new issue, #859: Android 12, moto g42 getPicture not response, no error

Lerolben opened a new issue, #859:
URL: https://github.com/apache/cordova-plugin-camera/issues/859

   # Bug Report
   
   ## Problem
   On android 12 (moto g42) `getPicture` method do nothing. Nothing happens. Nothing shows up. The method returns neither an error nor a success. The phone doesn't freeze. Just tap on my button and nothing happens. The promise is not fulfilled.
   
   LogCat shows only this:
   
   `To native (Cordova plugin): callbackId: Camera936725130, service: Camera, action: takePicture, actionArgs: [90,0,1,-1,400,0,0,false,true,false,null,0]`
   
   I have 2 other phones with android 12, and some phones with androids 9, 10, 11, 13 and everything works fine on them on the same app. I tried repeatedly to install the application, clear data, etc.
   
   ### What is expected to happen?
   The camera should open
   
   ### What does actually happen?
   Nothing
   
   ## Information
   - The problem only appears on my moto g42 (android 12)
   - I made sure that the camera on the phone works separately
   - Everything works fine on my other phones:
   -- 2 other phones with android 12 (Samsung s10, Oppo A54 5g)
   -- Some other phones with android: 9, 10, 11, 13
   
   ### Command or Code
   ```
   const options: CameraOptions = {
               quality: 90,
               allowEdit: false,
               destinationType: this.camera.DestinationType.FILE_URI,
               encodingType: this.camera.EncodingType.JPEG,
               sourceType: pictureSourceType,
               mediaType: this.camera.MediaType.PICTURE,
               correctOrientation: true,
           };
   this.camera.getPicture(options).then((imageData) => {
     // the code does not execute here
   ...
   , (err) => {
     //  the code here also doesn't execute          
    }
   ```
   
   ### Environment, Platform, Device
   - Android
   - Api target 33
   - cordova-plugin-camera: 7.0.0
   - Ionic 7.1.0
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Android 12, moto g42 getPicture not response, no error [cordova-plugin-camera]

Posted by "danielfnz (via GitHub)" <gi...@apache.org>.
danielfnz commented on issue #859:
URL: https://github.com/apache/cordova-plugin-camera/issues/859#issuecomment-2978708725

   This worked for me:
   https://github.com/jalios/cordova-plugin-camera


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Android 12, moto g42 getPicture not response, no error [cordova-plugin-camera]

Posted by "rideo-eduardmorales (via GitHub)" <gi...@apache.org>.
rideo-eduardmorales commented on issue #859:
URL: https://github.com/apache/cordova-plugin-camera/issues/859#issuecomment-1781325291

   We found this:
   
   > The Android OS may kill activities that are in the background to preserve memory, particularly if the foreground activity requires a lot of memory. When you use the Camera App, it puts your app into the background.
    
   This is documented here:
   
   > Android uses intents to launch the camera activity on the device to capture images, and on phones with low memory, the Cordova activity may be killed. In this scenario, the result from the plugin call will be delivered via the resume event. See the Android Lifecycle guide for more information. The pendingResult.result value will contain the value that would be passed to the callbacks (either the URI/URL or an error message). Check the pendingResult.pluginStatus to determine whether or not the call was successful.
   
   We're not sure if maybe that pendingResult.result is what we need to handle to recover the picture information…
   
   [source](https://github.com/apache/cordova-plugin-camera/issues/453)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Android 12, moto g42 getPicture not response, no error [cordova-plugin-camera]

Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #859:
URL: https://github.com/apache/cordova-plugin-camera/issues/859#issuecomment-2727101929

   May be fixed by https://github.com/apache/cordova-plugin-camera/pull/926
   
   If there is no camera application installed, or the camera application is disabled, the camera plugin will silently error without invoking the error callback.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Android 12, moto g42 getPicture not response, no error [cordova-plugin-camera]

Posted by "ZaKull (via GitHub)" <gi...@apache.org>.
ZaKull commented on issue #859:
URL: https://github.com/apache/cordova-plugin-camera/issues/859#issuecomment-1947283913

   using background plugin. 
   
   The error occurs when you have to exit the app to take a photo and then when you return. I recommend using the background plugin so that when you go to take a photo, you put the app in background mode and when you return, you remove it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Android 12, moto g42 getPicture not response, no error [cordova-plugin-camera]

Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #859:
URL: https://github.com/apache/cordova-plugin-camera/issues/859#issuecomment-2442809758

   If the activity gets killed during `getPicture` call (while the camera application is open), it's callback won't get called.
   
   When the activity gets reloaded it requires reconstructing the webview, which means your web app will also be re-loaded. The JS state is not restored.
   
   The response will be available inside the `resume` event however.
   
   This is likely the case. You can forcefully test this case by enabling developer options on the android device and then enable the `Don't Keep Activities` option in the Developer settings. With this enabled, the OS will always kill the activity when the Camera intent starts, allowing you to test the that quirk. It's part of normal android behaviour, so it's something that developers are expected to handle.
   
   This bug report sounds like this is the situation. @Lerolben were you able to confirm this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Android 12, moto g42 getPicture not response, no error [cordova-plugin-camera]

Posted by "viking2917 (via GitHub)" <gi...@apache.org>.
viking2917 commented on issue #859:
URL: https://github.com/apache/cordova-plugin-camera/issues/859#issuecomment-1751621087

   I have users reporting the same or similar issue on a Galaxy S23. I am unable to reproduce the problem myself on an older galaxy


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Android 12, moto g42 getPicture not response, no error [cordova-plugin-camera]

Posted by "Lerolben (via GitHub)" <gi...@apache.org>.
Lerolben commented on issue #859:
URL: https://github.com/apache/cordova-plugin-camera/issues/859#issuecomment-1751946706

   @viking2917 I have the latest version of the plugin, which works well on many of my phones running all versions of Android (8, 9, 10, 11, 12, 13). The problem only appears on Motorola G42 with Android 12. I don't know if it's a problem with this specific phone or Motorola G42 in general. 
   Please let me know if any of you have a G42 with Android 12 and this plugin works for you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Android 12, moto g42 getPicture not response, no error [cordova-plugin-camera]

Posted by "viking2917 (via GitHub)" <gi...@apache.org>.
viking2917 commented on issue #859:
URL: https://github.com/apache/cordova-plugin-camera/issues/859#issuecomment-1752138521

   Sorry I do not have a that device  :(
   
   
   
   On Sat, Oct 7, 2023 at 9:23 PM Lerolben ***@***.***> wrote:
   
   > @viking2917 <https://github.com/viking2917> I have the latest version of
   > the plugin, which works well on many of my phones running all versions of
   > Android (8, 9, 10, 11, 12, 13). The problem only appears on Motorola G42
   > with Android 12. I don't know if it's a problem with this specific phone or
   > Motorola G42 in general.
   > Please let me know if any of you have a G42 with Android 12 and this
   > plugin works for you.
   >
   > —
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/cordova-plugin-camera/issues/859#issuecomment-1751946706>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AB2VYVJKQN35FMSZBZPM6XDX6JIGJAVCNFSM6AAAAAA5MPHDTOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJRHE2DMNZQGY>
   > .
   > You are receiving this because you were mentioned.Message ID:
   > ***@***.***>
   >
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Android 12, moto g42 getPicture not response, no error [cordova-plugin-camera]

Posted by "Lerolben (via GitHub)" <gi...@apache.org>.
Lerolben commented on issue #859:
URL: https://github.com/apache/cordova-plugin-camera/issues/859#issuecomment-1782476559

   @rideo-eduardmorales Unfortunately, I still haven't found a solution to the problem. In my case the application does not restart. The plugin simply doesn't give any feedback.
   Maybe plugin developers should check `pendingResult.result` and what you wrote.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-camera] ivanprojetosti commented on issue #859: Android 12, moto g42 getPicture not response, no error

Posted by "ivanprojetosti (via GitHub)" <gi...@apache.org>.
ivanprojetosti commented on issue #859:
URL: https://github.com/apache/cordova-plugin-camera/issues/859#issuecomment-1741026658

   Hello i'm with the problem "No image Selected" after update the cordova for 12.0.1 e cordova-plugin-camera: 7.0.0 and my camera sometimes dont works.  Did you have this problem


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Android 12, moto g42 getPicture not response, no error [cordova-plugin-camera]

Posted by "viking2917 (via GitHub)" <gi...@apache.org>.
viking2917 commented on issue #859:
URL: https://github.com/apache/cordova-plugin-camera/issues/859#issuecomment-1751877394

   Following the thread here: https://github.com/apache/cordova-plugin-camera/issues/826, I installed this fork: https://github.com/jalios/cordova-plugin-camera/
   
   And my problem was solved. The problem appears to be related to new permission requirements on the latest Android, so older versions do not have the problem. 
   
   (v7 of the standard apache/cordova-plugin-camera apparently also fixes the problem, but I was unable to use it because I am fixing a very old app on ionic v1 which is pinned to android 10, which is too old for this plugin, but the jalios plugin was able to work for me.)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [I] Android 12, moto g42 getPicture not response, no error [cordova-plugin-camera]

Posted by "rideo-eduardmorales (via GitHub)" <gi...@apache.org>.
rideo-eduardmorales commented on issue #859:
URL: https://github.com/apache/cordova-plugin-camera/issues/859#issuecomment-1780792278

   @Lerolben We are having the same problem using the latest version of the plugin. Any news on your side?
   
   The device is a Motorola g51 5G in our case. When the device was with Android 11, the pictures were captured without problems, but after the device was updated to Android 12, it works only sometimes. From 10 attempts, only 2 finished successfully. 
   
   What happens is that after pressing the camera icon (to open camera), most of the time the app shows a white screen and fully reloads the app, so the app home screen is shown. 
   
   We have set the CameraOptions quality setting to 70 to try to minimize memory usage, but it doesn't seam to be this problem since the device has enough memory, and older devices, with far less memory, are working OK. 
   
   These are the devices/emulators we have verified it works OK:
   
   Samsung J5 (Android 9.0)
   Xiaomi Redmi 10 (Android 11)
   Samsung A13 (Android 13)
   Samsung XCover 5 (Android 13)
   Emulator (Android 12)
   Emulator (Android 12L)
   
   Sadly, we don't have another Android 12 device to try at the moment…
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org