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/01/09 11:39:57 UTC

[GitHub] [cordova-plugin-camera] naitikpatel1990 edited a comment on issue #689: After open the camera i get "Illegal Argument Exception".

naitikpatel1990 edited a comment on issue #689:
URL: https://github.com/apache/cordova-plugin-camera/issues/689#issuecomment-757136798


   Hey,
   
   I fixed by changed some code in CameraLauncher.java file but it's not proper as i did hardcoded there.
   
   in `public void takePicture(int returnType, int encodingType)` method  has following code:
   
   ```
   this.imageUri = new CordovaUri(FileProvider.getUriForFile(cordova.getActivity(),
                   applicationId + ".provider",
                   photo));
   ```
                   
   here somehow in ionic 5 `applicationId` got not found and throwing that error.
                
   so for now i hard coded like following:
        
   ```
   this.imageUri = new CordovaUri(FileProvider.getUriForFile(cordova.getActivity(),
                    "my.application.packgeID.provider", // my.application.packgeID is my app package id 
                   photo));
   ```
                   
   and bingo it's working. 
                 
   But we need proper solution to grab package id there it's not dynamic for now. Thank 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.

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