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


   # Bug Report
   After capture image app goes to crashed in ionic 3 app using camera plug in
   ## Problem
   After updated android-targetSdkVersion version ionic camera has crashed 
after taking picture in Redmi phone.
   
   ### What is expected to happen?
   It should work on each devices
   
   
   ### What does actually happen?
   App has crashed in Redmi 7A (Android version:-10QKQ1.191014.001)
   
   
   ## Information
   <!-- Include all relevant information that might help understand and 
reproduce the problem -->
   Hi I am working on ionic 3 and i has developed an capture image feature 
using camera plug-in. My app was working very well untill my targetSdkVersion 
was 28 in config.xml file (like this:- <preference 
name="android-targetSdkVersion" value="28" />).
   But targetSdkVersion 28 has blocked by google play store therefore i has 
updated it in 29 (like this:- <preference name="android-targetSdkVersion" 
value="29" />) and add  following line in config.xml 
   
   <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" 
target="/manifest/application" 
xmlns:android="http://schemas.android.com/apk/res/android";>
               <application android:largeHeap="true" 
android:networkSecurityConfig="@xml/network_security_config" 
android:requestLegacyExternalStorage="true" />
           </edit-config>
           <resource-file 
src="resources/android/xml/network_security_config.xml" 
target="app/src/main/res/xml/network_security_config.xml" />
   
   
   
   Then re-added platform "android 8.1.0", after that my camera has crashed 
each time whenever i am trying to capture image from my app.
   Device is :- Redmi 7A,
   Android version:-10QKQ1.191014.001
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   
   Add In config.xml:-
   
   <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" 
target="/manifest/application" 
xmlns:android="http://schemas.android.com/apk/res/android";>
               <application android:largeHeap="true" 
android:networkSecurityConfig="@xml/network_security_config" 
android:requestLegacyExternalStorage="true" />
           </edit-config>
           <resource-file 
src="resources/android/xml/network_security_config.xml" 
target="app/src/main/res/xml/network_security_config.xml" />
   
   
   following is my camera function code in .ts file:-
    const options: CameraOptions = {
         cameraDirection:1,
         correctOrientation:true,
         destinationType: this.camera.DestinationType.FILE_URI,
         sourceType:this.camera.PictureSourceType.CAMERA,
         encodingType: this.camera.EncodingType.JPEG,
         mediaType: this.camera.MediaType.PICTURE
       }  
       this.camera.getPicture(options).then((imagePath) => {
         console.log('camera function imagePath==', imagePath);
         this.currentName = imagePath;
         let name = this.currentName.split("/");    // code for fetching file 
name
         this.fileName = name[name.length - 1];
         console.log('this is camera file Name==',this.fileName);
       },(err) => {
         // alert(JSON.stringify(err));
         console.log('imagePath error==', err);
       });
   
   
   
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you 
experiencing the issue? -->
   My app's android platform version:- 8.1.1,
   Device is :- Redmi 7A,
   Android version:-10QKQ1.191014.001
   Camer plugin version:- "cordova-plugin-camera 4.1.0"
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   My app's android platform version:- 8.1.1,
   Device is :- Redmi 7A,
   Android version:-10QKQ1.191014.001
   Camer plugin version:- "cordova-plugin-camera 4.1.0"
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [ ] I searched for existing GitHub issues
   - [ ] I updated all Cordova tooling to most recent version
   - [ ] 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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to