I was working on my code. it was working fine on version 8(Oreo) after that I got an update of android v 9.0 (Pie) and the app stopped working suddenly. after checking I got
I was also facing the same issue but After Adding the below code in my manifest file the issue got resolved
for reference you can also check this url: https://developer.android.com/about/versions/pie/android-9.0-changes-28
manifest.xml