Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities

Hi,
I’m getting session not created exception when I run the below code in eclipse.
DesiredCapabilities cap=DesiredCapabilities.android();
cap.setCapability(“appPackage”, “io.appium.unlock”);
cap.setCapability(“appActivity”, “io.appium.unlock.Unlock”);
cap.setCapability(MobileCapabilityType.PLATFORM, Platform.ANDROID);
cap.setCapability(MobileCapabilityType.PLATFORM_NAME, “Android”);
cap.setCapability(MobileCapabilityType.DEVICE_NAME, “bc55c8c7d73”);
cap.setCapability(MobileCapabilityType.VERSION, “6.0.1”);
cap.setCapability(MobileCapabilityType.APP,“F://ApiDemos-debug.apk”);
URL url=new URL(“http://127.0.0.1:4723/wb/hub”);
driver=new AndroidDriver(url,cap);

Can any one please help me on the exception?

Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{appPackage=io.appium.unlock, appActivity=io.appium.unlock.Unlock, app=F://ApiDemos-debug.apk, browserName=android, platformName=Android, version=6.0.1, deviceName=bc55c8c7d73, platform=ANDROID}], required capabilities = Capabilities [{}]
Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’

Thanks.

you need to uninstall io.appium.setting and io.appium.unlock by using adb command

Thanks for the response.
I’m getting Failure [DELETE_FAILED_INTERNAL_ERROR] after running adb uninstall io.appium.unlock

go to settings-> developer options-> uncheck Turn on MIUI optimization Restart your device

Still getting the same exception.
Posting appium log, which may help you find the cause.

info: [debug] Responding to client that we did not find a valid resource

info: ← POST /wb/hub/session 404 41.516 ms - 47
info: → POST /wb/hub/session {“desiredCapabilities”:{“appPackage”:“io.appium.unlock”,“appActivity”:“io.appium.unlock.Unlock”,“app”:“F://ApiDemos-debug.apk”,“browserName”:“android”,“platformName”:“Android”,“version”:“6.0.1”,“deviceName”:“bc55c8c7d73”,“platform”:“ANDROID”},“requiredCapabilities”:{}}
info: [debug] Responding to client that we did not find a valid resource
info: ← POST /wb/hub/session 404 5.688 ms - 47
info: → POST /wb/hub/session {“capabilities”:[{“desiredCapabilities”:{“appPackage”:“io.appium.unlock”,“appActivity”:“io.appium.unlock.Unlock”,“app”:“F://ApiDemos-debug.apk”,“browserName”:“android”,“platformName”:“Android”,“version”:“6.0.1”,“deviceName”:“bc55c8c7d73”,“platform”:“ANDROID”}},{“requiredCapabilities”:{}}]}
info: [debug] Responding to client that we did not find a valid resource
info: ← POST /wb/hub/session 404 1.889 ms - 47

Please send me the Android OS version. I will try in my set up.

It’s ANDROID 6.0.1 MMB29M.

while installing sdk I installed android 6.0 API 23, and my version is
6.0.1, would this matters? I can see next version after 6 is 7.0.

Hi Jitu,
Did you get any chance to try on your setup?

i tried and its working sir. One thing you can do please share the team viewer of your system and i can try

Thanks Jitu, for trying on your setup.

This is my team viewer id: 721 609 754
Please let me know when want to connect.

Thanks,

Tell me when you are free

Hi Jitu,
Hope you are doing good.
Continuation to the issue that I’m facing where do you think the problem
could be?

That issue resolved??

Nope. Not yet. I could not get any solution even after Google search

Send me your whatsapp no

I have the same problem, who can help me?

Try by restarting your appium server

which adb command ??? please guide

adb uninstall io.appium.setting and adb uninstall io.appium.unlock on command prompt

I have gone through all the above suggestions but still no use of it, Can anyone help me.
Thanks in Advance.