Ionic app restarting after Camera Capture


#1

After capturing image and pressing tick mark, my application is restarting automatically in Moto Z play in Android Oreo. But it is working fine with any other mobiles but in some mobiles it is restarting the app.

Urgent, need solution. Please help me to solve this problem.


#2

Hi
you could watch to this github issue on the camera cordova plugin.


#3

It’s a memory problem and it’s how Android behave

I faced that problem and built a workaround using the provided Cordova lifecycle, I documented everything in https://forum.ionicframework.com/t/solved-camera-plugin-restart-app-on-android-8-1


#5

I didn’t get it how to solve this problem. Please help me.


#6

I already used background service, but no use with that.


#7

When you click on Camera in app does it ask for which app to choose for taking picture ?

If It does, i think that is the problem.

i also have this problem but never find any solution for this if anybody know any workaround please help me


#8

No it is not asking for anything like that. I am using default camera.


#9

Use DATA_Url instead of File


#10

Thanks for the reply dotman. While using DATA_URL only i am getting error.


#11

Can you show your code snippet?


#12

Add

<preference name="AndroidLaunchMode" value="singleTask" />

in config.xml