Unable to select spinner item in appium version 1.5.3

Platform : Android
Appium version ; 1.5.3
Simulator/Emulator or Real Device : Real Device
The language you are using for writing tests (client binding) : Java
Your OS : OS X El Capitan

I am not able to select a spinner item by using By.name method. I have read that By.name is deprecated. Can someone please help with the suitable alternate for selecting the spinner item.

org.openqa.selenium.InvalidSelectorException: Locator Strategy ‘name’ is not supported for this session (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 16 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/invalid_selector_exception.html
Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’
System info: host: ', ip: ‘’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11.5’, java.version: ‘1.7.0_75’
Session ID: 4989e272-08a6-49d9-8b79-23cdaf3a2c3f
Driver info: io.appium.java_client.android.AndroidDriver

By thisElementName = By.xpath = "//UIAStaticText[@name = 'whatever']"

driver.findElement(By.xpath("//UIAStaticText[@name ='theNameOfIt']"))