A new session could not be created

Hi,

I have installed the appium but while running the script getting A new session could not be created. message refer the below code
package firstPackage;

import java.net.MalformedURLException;
import java.net.URL;

import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;
import org.openqa.selenium.By;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.BrowserType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;

public class FirstAppiumClass
{

@Test
public void test1() throws MalformedURLException, InterruptedException{

// Create object of DesiredCapabilities class and specify android platform
DesiredCapabilities capabilities=DesiredCapabilities.android();

capabilities.setCapability(“no”,true);
capabilities.setCapability(“newCommandTimeout”, 100000);
capabilities.setCapability(“noReset”, true);

// set the capability to execute test in chrome browser
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME,BrowserType.CHROME);

// set the capability to execute our test in Android Platform
capabilities.setCapability(MobileCapabilityType.PLATFORM,Platform.ANDROID);

// we need to define platform name
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,“Android”);

// Set the device name as well (you can give any name)
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,“Redmi”);

// set the android version as well
capabilities.setCapability(MobileCapabilityType.VERSION,“6.0.1”);

// Create object of URL class and specify the appium server address
URL url= new URL(“http://127.0.0.1:4723/wd/hub”);
capabilities.setCapability(“noRest”, true);

// Create object of AndroidDriver class and pass the url and capability that we created
WebDriver driver = new AndroidDriver(url, capabilities);

// Open url000
driver.get(“http://www.facebook.com”);

// print the title
System.out.println("Title "+driver.getTitle());

// enter username
driver.findElement(By.name(“email”)).sendKeys(“[email protected]”);

// enter password
driver.findElement(By.name(“pass”)).sendKeys(“jaya@1234”);

// click on submit button
driver.findElement(By.id(“u_0_5”)).click();

Thread.sleep(5000);

// close the browser
driver.quit();

}
}

Following is the log

info: Appium REST http interface listener started on 127.0.0.1:4723
info: [debug] Non-default server args: {“address”:“127.0.0.1”,“logNoColors”:true,“platformName”:“Android”,“platformVersion”:“23”,“automationName”:“Appium”}
info: Console LogLevel: debug
info: → POST /wd/hub/session {“capabilities”:[{“desiredCapabilities”:{“no”:true,“noReset”:true,“newCommandTimeout”:100000,“browserName”:“chrome”,“platformName”:“Android”,“version”:“6.0.1”,“deviceName”:“Redmi”,“noRest”:true,“platform”:“ANDROID”}},{“requiredCapabilities”:{}}],“desiredCapabilities”:{“no”:true,“noReset”:true,“newCommandTimeout”:100000,“browserName”:“chrome”,“platformName”:“Android”,“version”:“6.0.1”,“deviceName”:“Redmi”,“noRest”:true,“platform”:“ANDROID”},“requiredCapabilities”:{}}
info: Client User-Agent string: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : no, version, noRest, platform
info: Set mode: Proxying straight through to Chromedriver
info: [debug] Looks like we want chrome on android
info: [debug] Creating new appium session b2f606aa-1851-4df9-a74f-1aa1a9c47dc8
info: [debug] Checking whether adb is present
info: [debug] Using adb from F:\Appium\AndroidSDK\platform-tools\adb.exe
info: [debug] Using fast reset? false
info: [debug] Preparing device for session
info: [debug] Not checking whether app is present since we are assuming it’s already on the device
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…
info: [debug] executing cmd: F:\Appium\AndroidSDK\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: Found device 3599216f9904
info: [debug] Setting device id to 3599216f9904
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: F:\Appium\AndroidSDK\platform-tools\adb.exe -s 3599216f9904 wait-for-device
info: [debug] executing cmd: F:\Appium\AndroidSDK\platform-tools\adb.exe -s 3599216f9904 shell “echo ‘ready’”
info: [debug] Starting logcat capture
info: [debug] Pushing unlock helper app to device…
info: [debug] executing cmd: F:\Appium\AndroidSDK\platform-tools\adb.exe -s 3599216f9904 install “F:\Appium\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk”
info: [debug] executing cmd: F:\Appium\AndroidSDK\platform-tools\adb.exe -s 3599216f9904 shell “dumpsys window”
info: Unlocking screen
info: [debug] Screen is locked, trying to unlock
info: [debug] Getting device API level
info: [debug] executing cmd: F:\Appium\AndroidSDK\platform-tools\adb.exe -s 3599216f9904 shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 23
info: [debug] executing cmd: F:\Appium\AndroidSDK\platform-tools\adb.exe -s 3599216f9904 shell “am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n io.appium.unlock/.Unlock”
error: Activity used to start app doesn’t exist or cannot be launched! Make sure it exists and is a launchable activity
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Activity used to start app doesn’t exist or cannot be launched! Make sure it exists and is a launchable activity
info: [debug] Error: Activity used to start app doesn’t exist or cannot be launched! Make sure it exists and is a launchable activity
at [object Object]. (F:\Appium\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:1146:21)
at [object Object]. (F:\Appium\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:180:9)
at ChildProcess.exithandler (child_process.js:742:7)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1016:16)
at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Activity used to start app doesn’t exist or cannot be launched! Make sure it exists and is a launchable activity)”,“origValue”:“Activity used to start app doesn’t exist or cannot be launched! Make sure it exists and is a launchable activity”},“sessionId”:null}
info: ← POST /wd/hub/session 500 13105.484 ms - 346

You can watch this video : https://youtu.be/uA8x3geLanA?list=PLXbcghgSZDroz9nez1IrbL2hnMVJ0ba1W

can you pls correct the spelling of noReset in below and check:

// Create object of URL class and specify the appium server address
URL url= new URL(“http://127.0.0.1:4723/wd/hub”);
capabilities.setCapability(“noRest”, true);