cleverappdesign edited a comment on issue #486: Android : Camera cannot be 
opened with Cordova 9
URL: 
https://github.com/apache/cordova-plugin-camera/issues/486#issuecomment-575944828
 
 
   ### The gallery works after I added the following permission in the 
config.xml:
   ```
   <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
   ```
   
   ### However, the camera is still not working:
   
   `Attempt to invoke virtual method 'android.content.res.XmlResourceParser 
android.content.pm.PackageItemInfo.loadXmlMetaData(android.content.pm.PackageManager,
 java.lang.String)' on a null object reference`
   
   At first, the initial try on opening the camera asked the user for 
permission, then it crashes the app. When you re-enter the app and tried to 
open the camera again, it throws the above error, which is same as @GuiF007 's 
issue.
   
   ### Adding the following code suggested above to config.xml did not fix my 
issue:
   ```
   <config-file mode="merge" parent="application" target="AndroidManifest.xml">
       <provider android:authorities="${applicationId}.provider" 
android:exported="false" android:grantUriPermissions="true" 
android:name="org.apache.cordova.camera.FileProvider">
           <meta-data android:name="android.support.FILE_PROVIDER_PATHS" 
android:resource="@xml/camera_provider_paths" />
       </provider>
   </config-file>
   ```
   
   ### Here's my ionic info
   ```
   Ionic:
      ionic (Ionic CLI)  : 4.10.2
      Ionic Framework    : ionic-angular 3.9.3
      @ionic/app-scripts : 3.2.2
   
   Cordova:
      cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
      Cordova Platforms     : android 8.1.0, ios 5.0.1
   ```
   
   Has anyone found a fix for this yet? Thanks for your help.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org
For additional commands, e-mail: commits-h...@cordova.apache.org

Reply via email to