Failed to start Appium Server:A new session could not be created. (Original error: UiAutomator quit before it successfully launched) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 3.05 seconds

I am new to using Appium . Did the setup and created a java sample test .When I am trying to execute the test always I am seeing the same issue . Not sure what this issue is exactly and how to overcome this .

“A new session could not be created. (Original error: UiAutomator quit before it successfully launched) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3.00 seconds”

My java Code:

package com.tests;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;

import io.appium.java_client.AppiumDriver;

import org.junit.After;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

public class AppiumTest {

private WebDriver driver ;
private DesiredCapabilities capabilities;
private URL serverAddress;

@BeforeTest
public void setUp() throws MalformedURLException{
	
	// set up appium

	File appDir = new File("/Users/sghali/Downloads/");

//
File app = new File(appDir, “LocalpointTester_testbrand1_stage.apk”);
capabilities = new DesiredCapabilities();
capabilities.setCapability(“appium-version”, “1.1.0”);
capabilities.setCapability(“platformName”, “Android”);
capabilities.setCapability(“deviceName”, “qa”);
capabilities.setCapability(“platformVersion”, “4.4”);
capabilities.setCapability(“app”, app.getAbsolutePath());
capabilities.setCapability(“appPackage”, “com.digby.lptester”);
capabilities.setCapability(“appActivity”, “com.digby.lptester.activity.AboutActivity”);
driver = new RemoteWebDriver(new URL(“http://127.0.0.1:4723/wd/hub”),capabilities);

}

@Test
public void sampleTest(){
	System.out.println("Do nothing here");
}

@After
public void quit(){
	driver.quit();
}

}

Appreciated your help

I am also observing the same issue. Any help would be highly appreciated.

Thanks in advance

Post logs from Appium’s and your test’s processes.

sorry for forgetting to share the logs.

The issue is resolved now. Tried many things not sure what made it work though