I'm attempting to upload a few small, pretty straightforward layers to ArcGIS Online, with the intent of creating a Feature Layer View of each one. These views will have some of their attributes hidden, then be added to my organization's Open Data Portal. The problem is, the Create View Layer process keeps failing with the extremely unhelpful message, "Error: Unable to add feature service definition", as seen in the attachment.
This is a workflow I've used many times before without issue, and indeed, it's only happening for two of the three layers in the current batch. The third one worked exactly as expected, and is currently in the Open Data Portal.
Further complicating things, my attempts to do an end-run around the issue are also meeting with failure. I made a copy of the data with the attributes we want to hide removed, uploaded the layers, and the copied layers just simply don't appear in the Open Data Portal regardless of sharing settings. These aren't complicated datasets - they have several hundred features at most, with 6-12 attributes, mainly short text fields.
Has anyone run into problems like these before? Did you find any solutions?
I'm also getting this error when I try to create a view layer. I've re-published the data several times from both Pro and ArcMap. What I have noticed:
I have three layers that have been grouped in my desktop project. When I publish them all together to AGOL, I get the error about the service definition when I go to create a public view layer. If I ungroup the data in my desktop, and remove the two additional layers, then re-publish... I can now create a public view layer in AGOL without any issue. So, I'm guessing that must be it--view layers can only be created from one hosted feature layer? If you publish multiple layers at a time, then the pubic view option does not work...? I wish I could find documentation to confirm this is the case, and a work around.
I am also getting the following error:
I have 6 stormwater layers that are not grouped in any way. Two of the layers have attachments, and the rest are just plain feature layers of point, line, or polygon features. They were all published to ArcGIS Online via ArcPro, and then I attempted to create feature layer views for editing permission control, and all but 1 worked as expected. One of the layers with attachments is the one that is causing me the problem, and I have no idea how to fix it. This is really killing my workflow.
I was able to fix my issue by exporting the layer that was giving me the issue to a FGDB, then republishing it from the FGDB (all directly on AGOL). I was then able to create my view from the newly published layer. The downside was that I then had to go fix all the web maps that contained the problem layer.
I have the same problem. I have published a feature layer to ArGIS Online via ArcGIS Pro. When I attempt to create a view layer I get the message "Unable to add feature service definition". I have tried republishing the layer (both grouped and ungrouped), exporting the layer to en FGDB and republishing but nothing works. Is there any other suggestion?
I finally got a workaround with Esri support on this one. My issue was related to a bug where there was html in the description field of a few of my layers. Workaround: in ArcGIS Pro, right click on the problematic layer in the Table of Contents. Select Properties. Navigate to the Metadata tab and choose 'Layer has its own Metadata' from the dropdown options. Make sure there is no text in the description. Click 'OK'. Then, republish the project as a web layer to ArcGIS Online. Once the layer is published, you should then be able to create a view layer.
I was getting a different error (screenshot) when trying to publish a hosted layer view, "The view layer could not be created. Try again." I followed the instructions in your post and I was able to successfully publish the view layer. Thank you!