原因是app management service没有设置好,在管理中心把他删掉,重新建一个就可以了
Provision App Management Service
In SharePoint 2013 Central Administration, in the left navigation bar, select Application Management.
In the Service Application section, choose Manage service applications.
In the Type column, select the line with App Management Service Application (the line, not the text).
In the Service Application ribbon, in the Operations group, select the Delete button.
In the Delete Service Application dialog box, ensure Delete data associated with the Service Applications is UNCHECKED.
Select OK twice.
In the Service Application ribbon, in the New group, select the App Management Service button.
In the New App Management Service Application dialog box, in the Service Application name field, type App Management Service - New (or the name you desire).
Scroll down the dialog box and ensure Create new application pool is selected. In the Application pool name field, type SPSServiceApplication (or the pool/name you desire).
In the Select a security account for this application pool section, select Predefined (or whatever account you use). Ensure the checkbox for Create App Management Service Application Proxy and add it to the default proxy group is checked.
Select OK.
Close SharePoint 2013 Central Administration.
__________________
Also make sure the State Service and its proxy are running in SharePoint 2013 Central Administration.