You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/09/23 21:50:45 UTC

[GitHub] [cordova-plugin-camera] WuglyakBolgoink opened a new issue #763: Cannot open camera only on Google Pixel 3

WuglyakBolgoink opened a new issue #763:
URL: https://github.com/apache/cordova-plugin-camera/issues/763


   # Bug Report
   
   ## Problem
   
   Cannot use camera app after migration on cordova-android@latest and cordova-plugin-camera@latest versions on GP-3.
   
   Tested on
   
   - huawei p20 pro - android 10 / IMUI 10
   - huawei p30 - android 10 / IMUI 11
   - Google Pixel 4 - android 11
   - Google Pixel 3 emulator
   
   All this devices can open camera app without problem.
   
   target SDK 30
   
   Related to #734, #673
   
   
   I don't have any access to the client logs to see what was happens. Any idea?
   
   Do we need to add this permission? https://developer.android.com/reference/android/Manifest.permission#CAMERA
   
   ## Checklist
   
   - [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

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] beard7 commented on issue #763: Cannot open camera only on Google Pixel 3

Posted by GitBox <gi...@apache.org>.
beard7 commented on issue #763:
URL: https://github.com/apache/cordova-plugin-camera/issues/763#issuecomment-957474271


   @WuglyakBolgoink How/where are you adding that? My AndroidManifest.xml already includes `<uses-permission android:name="android.permission.CAMERA" />`, but I've still got this issue on my GP3.
   
   


-- 
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] breautek edited a comment on issue #763: Cannot open camera only on Google Pixel 3

Posted by GitBox <gi...@apache.org>.
breautek edited a comment on issue #763:
URL: https://github.com/apache/cordova-plugin-camera/issues/763#issuecomment-926206930


   Cannot really speak on the root issue but
   
   > Do we need to add this permission? https://developer.android.com/reference/android/Manifest.permission#CAMERA
   
   This permission is only used for apps that uses the Camera APIs directly. This plugin does not use the Camera APIs. Instead it uses what Android calls Intents, which is to delegate the responsibility of taking an image using the camera by launching another app which **does** have the `Camera` permissions already to handle the camera operations. This is the recommended approach to use by Google and covers the needs of most apps.
   
   There is one caveat however, if the application declares that the app uses the `Camera` permission, then you must have the Camera permission to use Intents. This is a case already handled via:
   
   https://github.com/apache/cordova-plugin-camera/blob/0fba37cac3d2053d4c5f8acbb2cf0c5dbd0903be/src/android/CameraLauncher.java#L125
   
   and
   
   https://github.com/apache/cordova-plugin-camera/blob/0fba37cac3d2053d4c5f8acbb2cf0c5dbd0903be/src/android/CameraLauncher.java#L252-L284


-- 
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] beard7 commented on issue #763: Cannot open camera only on Google Pixel 3

Posted by GitBox <gi...@apache.org>.
beard7 commented on issue #763:
URL: https://github.com/apache/cordova-plugin-camera/issues/763#issuecomment-957474271


   @WuglyakBolgoink How/where are you adding that? My AndroidManifest.xml already includes `<uses-permission android:name="android.permission.CAMERA" />`, but I've still got this issue on my GP3.
   
   


-- 
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] WuglyakBolgoink commented on issue #763: Cannot open camera only on Google Pixel 3

Posted by GitBox <gi...@apache.org>.
WuglyakBolgoink commented on issue #763:
URL: https://github.com/apache/cordova-plugin-camera/issues/763#issuecomment-959155793


   Hallo @beard7 
   
   
   > @WuglyakBolgoink How/where are you adding that? My AndroidManifest.xml already includes `<uses-permission android:name="android.permission.CAMERA" />`, but I've still got this issue on my GP3.
   
   
   1. install 
       > `"cordova-custom-config": "5.1.0"`
   2. check your config
   3. add custom config for CAMERA permission, because original cordova "edit-config" remove the first permission from manifest file!!!
   4. remove your platform folder
   5. generate platform folder again
   ----
    
   ```xml
   <widget ...>
       <preference name="cordova-custom-config-autorestore" value="false" />
       <preference name="cordova-custom-config-stoponerror" value="true" />
       
       
   <platform name="android">
           <preference name="AndroidLaunchMode" value="singleTask" />
   
           <preference name="android-minSdkVersion" value="22" />
           <preference name="android-maxSdkVersion" value="31" />
           <preference name="android-targetSdkVersion" value="30" />
   
           <preference name="AndroidXEnabled" value="true" />
         
           <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity[@android:name='MainActivity']">
               <activity xmlns:tools="http://schemas.android.com/tools" />
           </edit-config>
           <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity[@android:name='MainActivity']">
               <activity android:requestLegacyExternalStorage="true" />
           </edit-config>
           <custom-config-file parent="./" target="AndroidManifest.xml">
               <uses-permission android:name="android.permission.CAMERA" />
           </custom-config-file>
       </platform>
   </widget>
   ```
   
   After that we can use camera on GP3 again...


-- 
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] beard7 commented on issue #763: Cannot open camera only on Google Pixel 3

Posted by GitBox <gi...@apache.org>.
beard7 commented on issue #763:
URL: https://github.com/apache/cordova-plugin-camera/issues/763#issuecomment-957474271


   @WuglyakBolgoink How/where are you adding that? My AndroidManifest.xml already includes `<uses-permission android:name="android.permission.CAMERA" />`, but I've still got this issue on my GP3.
   
   


-- 
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] WuglyakBolgoink commented on issue #763: Cannot open camera only on Google Pixel 3

Posted by GitBox <gi...@apache.org>.
WuglyakBolgoink commented on issue #763:
URL: https://github.com/apache/cordova-plugin-camera/issues/763#issuecomment-959155793


   Hallo @beard7 
   
   
   > @WuglyakBolgoink How/where are you adding that? My AndroidManifest.xml already includes `<uses-permission android:name="android.permission.CAMERA" />`, but I've still got this issue on my GP3.
   
   
   1. install 
       > `"cordova-custom-config": "5.1.0"`
   2. check your config
   3. add custom config for CAMERA permission, because original cordova "edit-config" remove the first permission from manifest file!!!
   4. remove your platform folder
   5. generate platform folder again
   ----
    
   ```xml
   <widget ...>
       <preference name="cordova-custom-config-autorestore" value="false" />
       <preference name="cordova-custom-config-stoponerror" value="true" />
       
       
   <platform name="android">
           <preference name="AndroidLaunchMode" value="singleTask" />
   
           <preference name="android-minSdkVersion" value="22" />
           <preference name="android-maxSdkVersion" value="31" />
           <preference name="android-targetSdkVersion" value="30" />
   
           <preference name="AndroidXEnabled" value="true" />
         
           <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity[@android:name='MainActivity']">
               <activity xmlns:tools="http://schemas.android.com/tools" />
           </edit-config>
           <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity[@android:name='MainActivity']">
               <activity android:requestLegacyExternalStorage="true" />
           </edit-config>
           <custom-config-file parent="./" target="AndroidManifest.xml">
               <uses-permission android:name="android.permission.CAMERA" />
           </custom-config-file>
       </platform>
   </widget>
   ```
   
   After that we can use camera on GP3 again...


-- 
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] WuglyakBolgoink edited a comment on issue #763: Cannot open camera only on Google Pixel 3

Posted by GitBox <gi...@apache.org>.
WuglyakBolgoink edited a comment on issue #763:
URL: https://github.com/apache/cordova-plugin-camera/issues/763#issuecomment-959155793


   Hallo @beard7 
   
   
   > @WuglyakBolgoink How/where are you adding that? My AndroidManifest.xml already includes `<uses-permission android:name="android.permission.CAMERA" />`, but I've still got this issue on my GP3.
   
   
   1. install 
       > `"cordova-custom-config": "5.1.0"`
   2. check your config
   3. add custom config for CAMERA permission, because original cordova "edit-config" remove the first permission from manifest file!!!
   4. remove your platform folder
   5. generate platform folder again
   ----
    
   ```xml
   <widget ...>
       ...
       <preference name="cordova-custom-config-autorestore" value="false" />
       <preference name="cordova-custom-config-stoponerror" value="true" />
   
       ...
       
       <platform name="android">
           <preference name="AndroidLaunchMode" value="singleTask" />
   
           <preference name="android-minSdkVersion" value="22" />
           <preference name="android-maxSdkVersion" value="31" />
           <preference name="android-targetSdkVersion" value="30" />
   
           <preference name="AndroidXEnabled" value="true" />
         
           <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity[@android:name='MainActivity']">
               <activity xmlns:tools="http://schemas.android.com/tools" />
           </edit-config>
   
           <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity[@android:name='MainActivity']">
               <activity android:requestLegacyExternalStorage="true" />
           </edit-config>
   
           <custom-config-file parent="./" target="AndroidManifest.xml">
               <uses-permission android:name="android.permission.CAMERA" />
           </custom-config-file>
       </platform>
   
       ...
   
   </widget>
   ```
   
   After that we can use camera on GP3 again...


-- 
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] WuglyakBolgoink commented on issue #763: Cannot open camera only on Google Pixel 3

Posted by GitBox <gi...@apache.org>.
WuglyakBolgoink commented on issue #763:
URL: https://github.com/apache/cordova-plugin-camera/issues/763#issuecomment-932125534


   @breautek manual adding `permission.CAMERA` fix the problem on GP3!


-- 
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] breautek commented on issue #763: Cannot open camera only on Google Pixel 3

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #763:
URL: https://github.com/apache/cordova-plugin-camera/issues/763#issuecomment-926206930


   Cannot really speak on the root issue but
   
   > Do we need to add this permission? https://developer.android.com/reference/android/Manifest.permission#CAMERA
   
   This permission is only used for apps that uses the Camera APIs directly. This plugin does not use the Camera APIs. Instead it uses what Android calls Intents, which is to delegate the responsibility of taking an image using the camera by launching another app which **does** have the `Camera` permissions already to handle the camera operations. This is the recommended approach to use by Google and covers the needs of most apps.
   
   There is one caveat however, if the application declares that the app uses the `Camera` permission, then you must have the Camera permission to use Intents. This is a case already via:
   
   https://github.com/apache/cordova-plugin-camera/blob/0fba37cac3d2053d4c5f8acbb2cf0c5dbd0903be/src/android/CameraLauncher.java#L125
   
   and
   
   https://github.com/apache/cordova-plugin-camera/blob/0fba37cac3d2053d4c5f8acbb2cf0c5dbd0903be/src/android/CameraLauncher.java#L252-L284


-- 
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] WuglyakBolgoink edited a comment on issue #763: Cannot open camera only on Google Pixel 3

Posted by GitBox <gi...@apache.org>.
WuglyakBolgoink edited a comment on issue #763:
URL: https://github.com/apache/cordova-plugin-camera/issues/763#issuecomment-959155793


   Hallo @beard7 
   
   
   > @WuglyakBolgoink How/where are you adding that? My AndroidManifest.xml already includes `<uses-permission android:name="android.permission.CAMERA" />`, but I've still got this issue on my GP3.
   
   
   1. install 
       > `"cordova-custom-config": "5.1.0"`
   2. check your config
   3. add custom config for CAMERA permission, because original cordova "edit-config" remove the first permission from manifest file!!!
   4. remove your platform folder
   5. generate platform folder again
   ----
    
   ```xml
   <widget ...>
       ...
       <preference name="cordova-custom-config-autorestore" value="false" />
       <preference name="cordova-custom-config-stoponerror" value="true" />
   
       ...
       
       <platform name="android">
           <preference name="AndroidLaunchMode" value="singleTask" />
   
           <preference name="android-minSdkVersion" value="22" />
           <preference name="android-maxSdkVersion" value="31" />
           <preference name="android-targetSdkVersion" value="30" />
   
           <preference name="AndroidXEnabled" value="true" />
         
           <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity[@android:name='MainActivity']">
               <activity xmlns:tools="http://schemas.android.com/tools" />
           </edit-config>
   
           <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity[@android:name='MainActivity']">
               <activity android:requestLegacyExternalStorage="true" />
           </edit-config>
   
           <custom-config-file parent="./" target="AndroidManifest.xml">
               <uses-permission android:name="android.permission.CAMERA" />
           </custom-config-file>
       </platform>
   
       ...
   
   </widget>
   ```
   
   After that we can use camera on GP3 again...


-- 
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] WuglyakBolgoink edited a comment on issue #763: Cannot open camera only on Google Pixel 3

Posted by GitBox <gi...@apache.org>.
WuglyakBolgoink edited a comment on issue #763:
URL: https://github.com/apache/cordova-plugin-camera/issues/763#issuecomment-959155793






-- 
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] WuglyakBolgoink commented on issue #763: Cannot open camera only on Google Pixel 3

Posted by GitBox <gi...@apache.org>.
WuglyakBolgoink commented on issue #763:
URL: https://github.com/apache/cordova-plugin-camera/issues/763#issuecomment-959155793






-- 
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