I\'m using DetectedActivityFence from Google Awareness API. It\'s working fine on my own devices, but I received a several crashes in Crashlytics about SecurityException
I struggled almost a day and found another answer. Although accepted answer was correct at that time.
The only thing helped me that is generating API key on Google Developer Console using debug keystore for testing purpose and replacing same with release keystore while going to production.
How generate API key? Please check out Google's word itself Here
Hope it will help someone in future.