Running testng.xml with tests using List of Id get error

Hello All,

I use some java method, in my appium tests, like this one :
@Override
public void clickMessages() {
List menuListId = driver.findElements(By.id(
Consts.ID_LIST_NAVIGATION_MENU_SELECTED_LAYOUT));
msgT = menuListId.get(1);
msgT.click();
}
When I run my tests one by one using Eclipse , every test exited correctly without any error. But when I run my testng.xml (from eclipse or maven command line or Jenkins) containing all my tests, I get more time this error:
at tests.general.TestInstallApk.testInstallApk(TestInstallApk.java:57)
at java.util.ArrayList.forEach(ArrayList.java:1257)
… Removed 34 stack frames

Or other error output like : lengh of list is zero and you use index(3) …