Appium IOS showing System.InvalidOperationException: no such element (An element could not be located on the page using the given search parameters

I am getting the error as System.InvalidOperationException: no such element (An element could not be located on the page using the given search parameters.
I am using Appium Studio since this I am working on in IOS using windows machine. At times I am able to locate the element using the same parameter. I have used xpath for finding the element.

Appium webdriver version 1.4.0.3

Please find the stack trace
Result StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElementByXPath(String xpath) at OpenQA.Selenium.By.<>c__DisplayClasse.<XPath>b__c(ISearchContext context) at OpenQA.Selenium.By.FindElement(ISearchContext context) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(By by) at OpenQA.Selenium.Appium.AppiumDriver1.FindElement(By by)
at SampleWork.UnitTest1.TestMethod1() in c:\users\user\documents\visual studio 2015\Projects\SampleTest\SampleWork\UnitTest1.cs:line 28
Result Message:
Test method SampleWork.UnitTest1.TestMethod1 threw exception:
System.InvalidOperationException: no such element (An element could not be located on the page using the given search parameters (XPATH=’//*[@value=‘username’]’))

You don’t say what version of iOS, but IIRC 1.4 supports up to iOS 8. If you are using a more recent version of iOS this is never going to work. I would suggest updating to at least 1.7.

The IOS version is 11.2.2.
Could you please tel me what IIRC since I am new to this.

This is a pretty good group of tutorials that covers the basics and more. Read through and come back with more specific questions:

http://toolsqa.com/mobile-automation/appium/appium-tutorial/