App is getting crashed on iOS 12 when device is connected to CarPlay.

Hi
I come across a particular scenario when my iOS app is getting crashed after some time. When my device is connected with carplay, application works fine for some time in the background but gets crashed after some time. It happens with devices having iOS version 12 or greater.
It is working fine on iOS 11 or less. I found that it is not device specific as well since it happens on all the devices. Also important thing to notice is that application doesn't use CarPlay framework or any map or audio feature. I am playing system music from my application using MPMusicPlayerController. CarPlay successfully plays the music but crashes after unspecific duration. Any idea why is it happening and how could I prevent the crash from happening?