You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2020/01/18 22:41:16 UTC

[GitHub] [cordova-plugin-camera] cleverappdesign edited a comment on issue #486: Android : Camera cannot be opened with Cordova 9

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 aboveto 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:
users@infra.apache.org


With regards,
Apache Git Services

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