title: java.lang.NullPointerException in appium
body: <p>This is my appium java code, after starting the test its stopping in app login method and says java.lang.NullPointerException. I tried all my possible solutions, but its not at all working please help to solve this problem</p>
  
  <pre><code>public class FirstAutomate {
  private WebDriver driver;
  
  @Test
  
  public void setup() throws Exception {
  
  
     File app = new File("C:\\sdk\\platform-tools\\Myapp.apk");
      DesiredCapabilities capabilities = new DesiredCapabilities();
      //capabilities.setCapability("BROWSER_NAME", "Android");
      capabilities.setCapability("VERSION", "5.0.2"); 
      capabilities.setCapability("deviceName","G3 Beat");
      capabilities.setCapability("appPackage", "com.skooly.app");
      capabilities.setCapability("appActivity","com.skooly.app.screens.prehomescreens.activities.SplashScreen");
      capabilities.setCapability("platformName","Android");
  
      capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,MobilePlatform.ANDROID);
      capabilities.setCapability("app", app.getAbsolutePath());
      try{
          driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
  
      }catch(MalformedURLException e)
      {
          e.printStackTrace();
  
      }
  
     // TODO Auto-generated method stub
  
  }
   @Test
  
      public void AppLogin() throws InterruptedException {
      //Tapping  button
       driver.findElement(By.id("loginButtonTextView")).click();
  }
  }
  </code></pre>