title: I m able to open and automate other apk with appium, but not able to op "Vlearning" apk with Appium script. getting error "SessionNotCretedException"
body: <p>This is my base class which is used to start Appium server</p>
  <pre><code>package VLearning.VLearningAppium;
  import java.io.File;
  import java.net.MalformedURLException;
  import java.net.URL;
  import java.time.Duration;
  
  import org.openqa.selenium.By;
  import org.openqa.selenium.JavascriptExecutor;
  import org.openqa.selenium.WebElement;
  import org.openqa.selenium.remote.RemoteWebElement;
  import org.testng.annotations.AfterClass;
  import org.testng.annotations.BeforeClass;
  
  import com.google.common.collect.ImmutableMap;
  
  import io.appium.java_client.android.AndroidDriver;
  import io.appium.java_client.android.options.UiAutomator2Options;
  import io.appium.java_client.service.local.AppiumDriverLocalService;
  import io.appium.java_client.service.local.AppiumServiceBuilder;
  
  public class VlearningBaseClass {
      
      public AndroidDriver driver;
      public AppiumDriverLocalService service;
      
      @BeforeClass
      public void appiumConfigure() throws MalformedURLException
      {
                 
                  //Code to start Appium server instead of starting Appium server manually in CMD. 
                  //Here main.js responsible for start Appium server, so we provided location of main.js
                  service = new AppiumServiceBuilder().withAppiumJS(new File(&quot;C:\\Users\\USER\\&quot;
                          + &quot;AppData\\Roaming\\npm\\node_modules\\appium\\build\\lib\\main.js&quot;)).withIPAddress(&quot;127.0.0.1&quot;).usingPort(4723).build();
                  service.start();
                  
                  
                  //UiAutomator2Options which is used to set device name,application location etc.
                  UiAutomator2Options options = new UiAutomator2Options();
                  //options.setDeviceName(&quot;Nexus_One_Appium&quot;);                    //device name, for virtual devices
                  options.setDeviceName(&quot;Android Device&quot;);                       //for real devices
                  
                  //set Chrome driver location for Selenium automation for hybrid application
                  //options.setChromedriverExecutable(&quot;C:\\Users\\USER\\eclipse-workspace\\VLearningAppium\\src\\test\\java\\resources\\chromedriver.exe&quot;); 
                  
                  //application location
                  //Vlearning apk
                   options.setApp(&quot;C:\\Users\\USER\\eclipse-workspace\\VLearningAppium\\src\\test\\java\\resources\\app-debug.apk&quot;);
                  
                  
                   driver = new AndroidDriver(new URL(&quot;http://127.0.0.1:4723&quot;), options); 
                  
                  //with the help of &quot;Appium inspector&quot; we can identify the element in App. For that we need to download and install that
                  //we have to give information to &quot;Appium inspector&quot; in which device,in which App we have to inspect
                  //so in &quot;Appium inspector&quot; we need to give information like app, deviceName, platformName, automationName
      
                   //implicit wait
                  driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(20));
      
      }
      
      
      public void longPressActio(WebElement ele)
      {
  
              ((JavascriptExecutor)driver).executeScript(&quot;mobile:  longClickGesture&quot;, 
                  ImmutableMap.of(&quot;elementId&quot;,((RemoteWebElement)ele).getId(),&quot;duration&quot;,2000));
          
      }
      
      public void scrollingTillEnd()
      {
          //scrolling till last
                  boolean canScrollMore;
                  do
                  {
                       canScrollMore = (Boolean)((JavascriptExecutor) driver).executeScript(&quot;mobile: scrollGesture&quot;, ImmutableMap.of(
                               &quot;left&quot;,100,&quot;top&quot;,100,&quot;width&quot;,200,&quot;height&quot;,200,&quot;direction&quot;,&quot;down&quot;,&quot;percent&quot;,3.0));
                       
                  }while(canScrollMore);
  
      }
      
      
      public void swipeAction(WebElement ele,String direction)
      {
          ((JavascriptExecutor) driver).executeScript(&quot;mobile: swipeGesture&quot;,ImmutableMap.of(
                  &quot;elementId&quot;,((RemoteWebElement)ele).getId(),
                  &quot;direction&quot;,direction,
                  &quot;percent&quot;,0.75
                  ));
      }
      
      public void dragAndDropAction(WebElement ele)
      {
          ((JavascriptExecutor) driver).executeScript(&quot;mobile: dragGesture&quot;, ImmutableMap.of(
                  &quot;elementId&quot;,((RemoteWebElement) ele).getId(),
                  &quot;endX&quot;,355,
                  &quot;endY&quot;,316));
      }
      
      
      public double getFormatedAmount(String amount)
      {
          double price = Double.parseDouble(amount.substring(1));
          return price;
      }
      
      
      @AfterClass
      public void tearDown()
      {
          driver.quit();
          service.stop();
      }
  
  }
  </code></pre>
  <p>'''</p>
  <p>This is test cases inheriting above base class</p>
  <pre><code>package VLearning.VLearningAppium;
  
  import org.openqa.selenium.By;
  import org.testng.annotations.Test;
  
  public class VlearningLogin extends VlearningBaseClass{
      
      
      
      @Test
      public void login()
      {
          driver.findElement(By.xpath(&quot;//android.widget.Button[@text='NEXT']&quot;)).click();     //Next button
          driver.findElement(By.xpath(&quot;//android.widget.Button[@text='Get Started']&quot;)).click(); //Get Started Button
          
          
      }
  
  }
  </code></pre>
  <p>'''
  I m getting error like this</p>
  <pre><code>[RemoteTestNG] detected TestNG version 7.6.1
  SLF4J: Failed to load class &quot;org.slf4j.impl.StaticLoggerBinder&quot;.
  SLF4J: Defaulting to no-operation (NOP) logger implementation
  SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
  [35m[Appium][39m Welcome to Appium v2.0.0-beta.42
  [35m[Appium][39m Non-default server args:
  [35m[Appium][39m { address: [32m'127.0.0.1'[39m }
  [35m[Appium][39m Attempting to load driver uiautomator2...
  [debug] [35m[Appium][39m Requiring driver at C:\Users\USER\.appium\node_modules\appium-uiautomator2-driver
  [35m[Appium][39m Appium REST http interface listener started on 127.0.0.1:4723
  [35m[Appium][39m Available drivers:
  [35m[Appium][39m   - uiautomator2@2.4.6 (automationName 'UiAutomator2')
  [35m[Appium][39m No plugins have been installed. Use the &quot;appium plugin&quot; command to install the one(s) you want to use.
  FAILED CONFIGURATION: @BeforeClass VLearning.VLearningAppium.VlearningBaseClass.appiumConfigure
  org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.vista.vlearning' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: 'com.vista.vlearning.SplashActivity' or 'com.vista.vlearning.com.vista.vlearning.SplashActivity' never started. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting
  Build info: version: '4.4.0', revision: 'e5c75ed026a'
  System info: host: 'DESKTOP-K1E715A', ip: '192.168.1.113', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.16.1'
  Driver info: io.appium.java_client.android.AndroidDriver
  Command: [null, newSession {capabilities=[{appium:deviceName=Android Device, platformName=ANDROID, appium:automationName=UIAutomator2, appium:app=C:\Users\USER\eclipse-workspace\VLearningAppium\src\test\java\resources\app-debug.apk}], desiredCapabilities=Capabilities {appium:app: C:\Users\USER\eclipse-works..., appium:automationName: UIAutomator2, appium:deviceName: Android Device, platformName: ANDROID}}]
  Capabilities {}
      at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:144)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at io.appium.java_client.remote.AppiumProtocolHandshake.createSession(AppiumProtocolHandshake.java:126)
      at io.appium.java_client.remote.AppiumProtocolHandshake.createSession(AppiumProtocolHandshake.java:102)
      at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:146)
      at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:180)
      at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:547)
      at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:224)
      at org.openqa.selenium.remote.RemoteWebDriver.&lt;init&gt;(RemoteWebDriver.java:157)
      at io.appium.java_client.AppiumDriver.&lt;init&gt;(AppiumDriver.java:79)
      at io.appium.java_client.AppiumDriver.&lt;init&gt;(AppiumDriver.java:87)
      at io.appium.java_client.android.AndroidDriver.&lt;init&gt;(AndroidDriver.java:116)
      at VLearning.VLearningAppium.VlearningBaseClass.appiumConfigure(VlearningBaseClass.java:59)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139)
      at org.testng.internal.invokers.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:69)
      at org.testng.internal.invokers.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:361)
      at org.testng.internal.invokers.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:296)
      at org.testng.internal.invokers.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:180)
      at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:122)
      at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
      at org.testng.TestRunner.privateRun(TestRunner.java:806)
      at org.testng.TestRunner.run(TestRunner.java:601)
      at org.testng.SuiteRunner.runTest(SuiteRunner.java:433)
      at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:427)
      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:387)
      at org.testng.SuiteRunner.run(SuiteRunner.java:330)
      at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95)
      at org.testng.TestNG.runSuitesSequentially(TestNG.java:1256)
      at org.testng.TestNG.runSuitesLocally(TestNG.java:1176)
      at org.testng.TestNG.runSuites(TestNG.java:1099)
      at org.testng.TestNG.run(TestNG.java:1067)
      at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
      at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
      at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
  
  
  '''
  </code></pre>
  <p>But when I place other apk location in</p>
  <pre><code>options.setApp(&quot;&quot;);
  </code></pre>
  <p>I am able to open and automate with appium..
  but I am getting error when I place &quot;Vlearning&quot; apk in</p>
  <pre><code>options.setApp(&quot;&quot;);
  </code></pre>
  <p>when I posted this error in Udemy one instructor told me ist apk permission issue..if its Vlearning apk permission issue then how to resolve it?</p>