Home > Tips and Tricks

Exception occurred while executing grant: How to Fix

In this guide, we will show you the steps to fix the “Exception occurred while executing grant” error. Many OnePlus, Oppo, and Vivo users have voiced their concern that whenever they try to execute a specific ADB or rather the ADB shell command, then they are greeted with the aforementioned error message and the command fails to execute.

In most cases, this usually happens when they are trying to grant system-level API access to a third-party app. So if you are also getting bugged by this “Exception occurred while executing grant” error message, then this guide will make you aware of a method to rectify this issue once and for all/ So without further ado, let’s get started.

Fix Exception occurred while executing grant

In order to fix this issue, all that you need to do is turn off Permission Monitoring, or in more confusing terms, enable “Disable Permission Monitoring” in OnePlus or Disable MIUI Optimization in Xiaomi [Poco/Redmi/Mi]. Here’s how it could be done:

OnePlus

  1. Head over to Settings > About Phone > Tap on Build Number 7 times.
  2. Then go to Settings > System > Developer Options.Exception occurred while executing grant
  3. Now enable the toggle next to “Disable Permission Monitoring”.
  4. Finally, force stop the app to whom you are granting the WRITE SECURE SETTINGS permissions and then re-execute the ADB command.

Xiaomi

  1. Head over to Settings > About Phone > Tap on MIUI version 7 times.
  2. Then go to Settings > Additional Settings > Developer Options.
  3. Now tap on Reset to Default Values 5 times.Exception occurred while executing grant
  4. This will bring the “Turn off MIUI Optimization” option. Disable its toggle, wait for 5 seconds, and tap on Accept.
  5. If you have the USB Debugging (Security Settings) option [under Developer Options], then “enable” it as well.usb debugging security settings
  6. Now force stop the app to whom you are granting the WRITE SECURE SETTINGS permissions and then re-execute the ADB command.

That’s it. These were the steps to fix the “Exception occurred while executing grant” error. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.


Share: