Select to view content in your preferred language

ArcGis Map for Swift SDK giving error on adding Feature layer

2356
11
Jump to solution
04-05-2024 07:37 AM
ShrutiVaman
Emerging Contributor

Hello,

I am trying to add Shapefile to the ArcGis map creating a Feature layer. But SDK always gives me an error saying FileNotFoundError(details: "Invalid path or missing shapefile data.") 

I am following the code from GitHub https://github.com/Esri/arcgis-maps-sdk-swift-samples

I also tried loading the same shapefiles on ArcGis online it worked. 

Can anyone help me fix this problem?

0 Kudos
11 Replies
ShrutiVaman
Emerging Contributor

This worked. Thank you so much for the solution. Swift SDK sample code hasn't mentioned I need a UTType extension. So, I was stuck there. 

Can you please let me know if there are any problems with the attached shape files? I am not able to create a feature layer and it gives me following error

FileNotFoundError(details: "Invalid path or missing shapefile data.")

0 Kudos
Ting
by Esri Contributor
Esri Contributor

I'm not a GIS expert, so I don't know too much about the file structure intrinsics. To my understanding, a shapefile must contain at least 3 files: .shp, .shx, and .dbf. Your zip only has the .shp files.

Maybe ask the question in https://community.esri.com/t5/arcgis-pro-questions/bd-p/arcgis-pro-questions to have someone examine your files. Maybe the person who exported these files missed the require metadata.