I\'m trying to run a test that just opens whatsapp messenger using appium. I\'m getting the error: A new session could not be created. (Original error: \'java -versi
Problem solved! For some reason there was missing the path for System32 in my PATH variable! I realized it when i run android on command line and there was a message: xcopy is not recognized as an internal or external command although sdk manager was running normally.
You need to open the appium application and launch it using the same capabilities in your code. If you are already opened it the stop it and relaunch it again, after that run your test again.
You also need to make sure of your JAVA_HOME and ANDROID_HOME
you need to have driver.quit() in your code.