When trying to configure App urls from SharePoint 2013 central admin you might encounter the dreaded error “Object reference not set to an instance of an object”.
Most common reason for the error is that you are trying to configure App settings without creating service applications and corresponding proxies for App Management Service and Microsoft SharePoint Foundation Subscription Settings Service.
Below are the steps to fix the issue
1. Start the App Management Service from central administration.
2. Start the Microsoft SharePoint Foundation Subscription Settings Service from central administration.
3. Configure the App Management service application and proxy from central administration or PowerShell
4. Configure the Subscription Settings service application and proxy from PowerShell