'Location Aware Exception After upgrading to Android Studio 3.1 - Build Failed

I am facing an issue of build getting failed. I recently upgraded my android studio. And the look and feel has good changes in the IDE. But there is something I am stuck at. After making a few changes in the existing code I am trying to run the project and the build always fails with an error (Look at the image)

enter image description here

I tried to look for a lot of possible solutions and didn't find anything correct. Help me out someone :p



Solution 1:[1]

Here you go with a simple and funny solution:

enter image description here

just follow the image.

Have fun. Happy Coding

Solution 2:[2]

Check for local.properties is there any key missing or some property is missing at the time of update it might got reset

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ashutosh Tiwari
Solution 2 RUSHIKESH KARDE