Today, I had this error when I was trying to deploy a simple Hello World App for first time.
I tried everything on this blog and still didnt work.
Guys, let me tell you what my problem was.
When I first started I was developing with the farm account, suddently when I was trying to deploy VS says that you can not use the system account to deploy apps. Read the link above.
So, I logged in with my account, and the mistake was this: I created the app management service application and the new web application with my username, yes its farm admin, yes its local administrator.
The problem is the farm account has a server role of db creation and security admin, this means that when this account tries to create databases, it will also make the security adjustments needed on the databases for the configuration to be correct.
Because I tried to do this with a normal user account which has no Sql Server roles, then the Content DB was created, and the app management service application was created too.
However, it didnt set up the security on the databases the right way
After following the post above, and checking the logs with the dba we saw this error :
There is a compatibility range mismatch between the Web server and database
We double checked permissions and they were all set correctly.
1. Delete the app management service application.
2. Delete the new web application content database.
Fortunately it was a development environment, after recreating these 2 things, the app was succesfully deployed using F5 on Vs 2012.