Recently while working with sharepoint-hosted apps I got the below error. The error message shows: This task requires the application to have elevated permission. Restart under different credentials. Cancel the task and return to Microsoft Visual Studio.
Also you can check out:
While deploying an sharepoint-hosted app, I got the error as:Error occurred in deployment step 'Install app for SharePoint': The System Account cannot perform this action. So I followed this article
and created a another account. I added that account to the farm administrator group.
Then I open visual studio with the new account, but when I deploy the app, I got the above error. But when I add the account to the developer site's administrator group, it got resolved.
To add the user to the site administrator group, go to Site Settings and then click on "Site collection administrators" from the Users and Permissions section.