Select to view content in your preferred language

ArcGISRuntimeException: Geodatabase field exists while using FeatureLayer with ServiceFeatureTable

901
1
Jump to solution
04-25-2023 07:00 AM
VipulPurohit
Emerging Contributor

Hello,

I am encountering an error while using the FeatureLayer with ServiceFeatureTable in my ArcGIS Runtime SDK for Android application. The error message is:

"com.esri.arcgisruntime.ArcGISRuntimeException: Geodatabase field exists.: objectid"

I am not sure what this error means or how to fix it. Here is the Kotlin code that I am using:

       // create and load the service geo database
        val serviceUrl =
            "my_feature_service_url"
        val serviceFeatureTable = ServiceFeatureTable(serviceUrl)

        // create a feature layer from table
        val featureLayer = FeatureLayer(serviceFeatureTable)
        // add the layer to the map
        mapView?.map?.operationalLayers?.add(featureLayer)
        featureLayer.loadAsync()

        // zoom to the layer when it's done loading
        featureLayer.addDoneLoadingListener {
            if (featureLayer.loadStatus == LoadStatus.LOADED) {
                // set viewpoint to feature layer extent
                mapView?.setViewpointAsync(Viewpoint(featureLayer.fullExtent))
            } else {
                featureLayer.loadError.printStackTrace()
                val error = "Error loading feature layer :" + featureLayer.loadError.message
                Toast.makeText(context, error, Toast.LENGTH_LONG).show()
                Log.e("FeatureError", error)
            }
        }

 

I would appreciate any guidance or suggestions on how to resolve this error.

Thank you!

0 Kudos
1 Solution

Accepted Solutions
DiveshGoyal
Esri Regular Contributor

Can you inspect the fields of the feature service layer and see if it contains duplicate objectid fields. This sometimes happens if the service was published containing joins between datasets. 
if so, you can rename the duplicate field and republish the service to resolve this issue

View solution in original post

1 Reply
DiveshGoyal
Esri Regular Contributor

Can you inspect the fields of the feature service layer and see if it contains duplicate objectid fields. This sometimes happens if the service was published containing joins between datasets. 
if so, you can rename the duplicate field and republish the service to resolve this issue