title: Appium and android studio
body: <p>I have installed Appium on ubuntu and make my first test using java command in an android studio while running my test I get an error</p>
  
  <blockquote>
    <p>A new session could not be created. (Original error: Requested a new
    session but one was in progress) (WARNING: The server did not provide
    any stacktrace information) Command duration or timeout: 603.92
    seconds</p>
  </blockquote>
  
  <pre><code>public class MyTest {
  
      AndroidDriver driver;
  
      @Before
      public void testCaseSetup()throws  Exception {
          //service.start();
          //reader.readFile();
          DesiredCapabilities cap = new DesiredCapabilities();
          cap.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
          cap.setCapability(MobileCapabilityType.DEVICE_NAME, "Nexus_5");
          cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, "5.0.2");
          cap.setCapability(MobileCapabilityType.APPIUM_VERSION, "v1.4.7");
          cap.setCapability(MobileCapabilityType.APP_PACKAGE, "com.example.nitish.myappium");
          cap.setCapability(MobileCapabilityType.APP_ACTIVITY, ".MainActivity");
          driver = new AndroidDriver&lt;MobileElement&gt;(new URL("http://0.0.0.0:4723/wd/hub"), cap);
      }
  
  
          @Test
  
          public void testcase1()throws  Exception
          {
              driver.findElement(By.id("com.example.nitish.myappium:id/front")).click();
  
          }
  
      @After
      public void testCaseTearDown()
      {
          driver.quit();
      }
  
  
  }
  </code></pre>