Error Session has been terminated


#1

Hello, I have such a problem I can not run the test.
I use:
Appium Version 1.5.0
Genymotion Emulator
InteliJ IDEA
Mac OS High Siera 10.13.6

   capabilities.setCapability("platformName","Android");
    capabilities.setCapability("deviceName","AndroidTestDevice");
    capabilities.setCapability("platformVersion ","6.0");
    capabilities.setCapability("automationName","Appium");
    capabilities.setCapability("appPackage","org.Wikipedia");
    capabilities.setCapability("appActivity",".main.MainActivity");

capabilities.setCapability(“app”,"/Users/name/Desktop/JavaAppiumAutomation/apks/org.wikipedia.apk");

driver = new AndroidDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities);

My step by step:
1)I connect the apium to the emulator
2)Start inspection session
3)At InteliJ IDEA run test

Then the test crashes and gives this error in InteliJ Original error: Error occured while starting App. Original error: Activity used to start app doesn’t exist or cannot be launched! Make sure it exists and is a launchable activity

At this moment, appium resets the application and gives an error
Error
Session has been terminated


#2

Try adding

 capabilities.setCapability("appWaitActivity", appWaitActivityVariable);