What version of ArcGIS are you using?
If version Desktop 10.6, have you installed the ArcGIS 10.6 ECW Patch that was released by ESRI?
What specific error is occurring?
if you are running this on ArcGIS Server ECW is not natively supported. Please see the following link pertaining to support for ECW files. http://enterprise.arcgis.com/en/server/latest/publish-services/windows/20026-layer-is-an-ecw-format-...