ArcGISRuntimeException when loading a FeatureLayer - Unknown error: invalid uuid string

786
9
Jump to solution
10-30-2023 08:29 AM
PierreMasson
Occasional Contributor

I have a Feature layer published that I'm trying to load in a small proof of concept projet with ArcGIS Map SDK .Net. 

When this code is called:

var featureLayer1 = new FeatureLayer(item, i) { MinScale = 500000000, MaxScale = 1 };
Map.OperationalLayers.Add(featureLayer1);

I get this error:

ArcGIS Maps SDK: Load Error: FeatureLayer
Esri.ArcGISRuntime.ArcGISRuntimeException
Unknown error: invalid uuid string

The feature has many fields and 4 or 5 of them are of type esriFieldTypeGUID like this one:

inspectionid ( modelName: inspectionid, nullable: false, editable: true, defaultValue: null, length: 38, alias: InspectionId, type: esriFieldTypeGUID )

All the guids in those columns are valid guids but the SDK seem to have a problem with them.

Is it a bug? What am I missing?

0 Kudos
1 Solution

Accepted Solutions
ThadTilton
Esri Contributor

OK, with the help of some colleagues here on the Maps SDK .NET team, I think we've narrowed down the issue. If you look at the raw JSON for either of the layers, you'll see templates defined that look something like this:

      "templates" : [
        {
          "name" : "Nor Reviewed", 
          "description" : "", 
          "drawingTool" : "esriFeatureEditToolPoint", 
          "prototype" : {
            "attributes" : {
              "Id" : "false"
            }
          }
        }
      ]

 The template refers to the ID field (or GlobalID in others). Those fields store GUID types but the template specifies a value of "true" or "false". When trying to load the layer, Maps SDK for .NET fails when parsing that because it can't convert those values to a UUID.

I'm not sure how this definition is authored, but if you can find a way to remove that or reauthor the definition to exclude those settings, the layers should load as expected.

View solution in original post

0 Kudos
9 Replies
ThadTilton
Esri Contributor

Hi Pierre,

I'm not sure what's going on here. I wonder if the error is complaining about the ID that's used to identify the layer in the FeatureService portal item. The value of "i" in this line of code:

var featureLayer1 = new FeatureLayer(item, i) { MinScale = 500000000, MaxScale = 1 };

0 Kudos
PierreMasson
Occasional Contributor

Hi, the variable i is 0 and 1 since my Feature Layer has 2 layers


for (int i = 0; i < 2; i++)
{
var featureLayer1 = new FeatureLayer(item, i) { MinScale = 500000000, MaxScale = 1 };
Map.OperationalLayers.Add(featureLayer1);
}

The FeatureLayer ID is good. I have another simple featurelayer (with no GUIDS) and it loads perfectly. 

0 Kudos
PierreMasson
Occasional Contributor

I've set that FeatureLayer public if you want to try it and see what's wrong. 
https://aquadata.maps.arcgis.com/home/item.html?id=5db2b9ea5a384bb894d36d5c03555b99

0 Kudos
ThadTilton
Esri Contributor

I get "the username you entered is not part of this organization" when I try to access it.

0 Kudos
PierreMasson
Occasional Contributor

This is a show stopper for us right now. We would appreciate your help on this. We have figure out most of the things around that, and it will allow us to go forward with the development after that. Thank you.

0 Kudos
ThadTilton
Esri Contributor

Hi Pierre,

I queried all the GUID and GlobalID fields in the pipes and manholes layers and checked them in a simple .NET program to see if they were valid. I wasn't able to find any invalid GUIDs. I also brought the layers into Pro and wasn't able to find anything unusual.

Perhaps I can try to reproduce this with some of my own data and try to narrow down the issue.

0 Kudos
ThadTilton
Esri Contributor

OK, with the help of some colleagues here on the Maps SDK .NET team, I think we've narrowed down the issue. If you look at the raw JSON for either of the layers, you'll see templates defined that look something like this:

      "templates" : [
        {
          "name" : "Nor Reviewed", 
          "description" : "", 
          "drawingTool" : "esriFeatureEditToolPoint", 
          "prototype" : {
            "attributes" : {
              "Id" : "false"
            }
          }
        }
      ]

 The template refers to the ID field (or GlobalID in others). Those fields store GUID types but the template specifies a value of "true" or "false". When trying to load the layer, Maps SDK for .NET fails when parsing that because it can't convert those values to a UUID.

I'm not sure how this definition is authored, but if you can find a way to remove that or reauthor the definition to exclude those settings, the layers should load as expected.

0 Kudos
PierreMasson
Occasional Contributor

Thank you! I had to remove the symbology before publishing the layer to get rid of the template. Deleting templates was not working. It works now. Thanks again!

0 Kudos