A quick tip that might help you if you are setting up a new SharePoint 2013 environment. This tip applies if you get the following symptoms when trying to browse a SharePoint hosted App via your development site collection:
- You get Invalid URI: The hostname could not be parsed errors in your event log
- Your app doesn’t render correctly with all CSS and images having been stripped away. Using fiddler you might be able to see an HTTP 500 error coming back on each resource request
In my case the issue was a little embarrassing. For reasons that elude me just now I had created the new SharePoint 2013 farm without creating a default/root site collection.
Once you create your root site collection the issue should go away and is probably caused by the development site collection referencing core files in the layouts folder at the root of the site.
Hope that helps someone as it was doing my head in for about an hour!