Ionic app restarting after Camera Capture

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.

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

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

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

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

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

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

Use DATA_Url instead of File

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

Can you show your code snippet?

Add

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

in config.xml

2 Likes