I made an app and tested everything. I was working fine in emulators and in USB-connected devices but did not work when generating signed apk file. I have made the app with both disabled/enabled instant run and it still didn't work.
I also tried uninstalling (for all users) and reinstalling the apk, still the issue remained (but application works fine with build apk). I have possibly tried all solutions available in similar posts but I can't find a solution, any help would be much appreciated.