# ERROR - A new session could not be created for android appium

**URL:** <https://discuss.appium.io/t/error-a-new-session-could-not-be-created-for-android-appium/2571>\
**Category:** Issues/Bugs\
**Created:** [January 26, 2015, 9:13pm UTC](https://discuss.appium.io/t/error-a-new-session-could-not-be-created-for-android-appium/2571 "2015-01-26T21:13:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![MuthuSelvan](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/779978/32.png) [@MuthuSelvan](https://discuss.appium.io/u/MuthuSelvan)\
**Post date:** [January 26, 2015, 9:13pm UTC](https://discuss.appium.io/t/error-a-new-session-could-not-be-created-for-android-appium/2571/1 "2015-01-26T21:13:38Z")

</div>

Hi All ,

Getting the below error when i am running selenium based grid in appium ,

**ERROR**

log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).  
log4j:WARN Please initialize the log4j system properly.  
**Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Requested a new session but one was in progress) (WARNING: The server did not provide any stacktrace information)**  
Command duration or timeout: 121 milliseconds  
Build info: version: ‘2.43.1’, revision: ‘5163bceef1bc36d43f3dc0b83c88998168a363a0’, time: ‘2014-09-10 09:43:55’  
System info: host: ‘LM-sjn-00877356’, ip: ‘10.244.65.221’, os.name: ‘Mac OS X’, os.arch: ‘x86\_64’, os.version: ‘10.10.1’, java.version: ‘1.7.0\_71’  
Driver info: org.openqa.selenium.remote.RemoteWebDriver  
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)  
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)  
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)  
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)  
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)  
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)  
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)  
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)  
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126)  
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:153)  
at com.paypal.selion.android.sample.AndroidGrid.main(AndroidGrid.java:63)

**APPIUM NODE CONSOLE :**

**COMMAND :** appium --nodeconfig /Users/mselvansr/grid/android1.json -p 4728  
info: Welcome to Appium v1.3.4 (REV c8c79a85fbd6870cd6fc3d66d038a115ebe22efe)  
info: Appium REST http interface listener started on 0.0.0.0:4728  
info: [debug] Non-default server args: {“port”:4728,“nodeconfig”:"/Users/mselvansr/grid/android1.json"}  
info: Console LogLevel: debug  
info: [debug] starting auto register thread for grid. Will try to register every 5000 ms.  
**info: [debug] Appium successfully registered with the grid on 127.0.0.1:4433**  
info: --\> GET /wd/hub/status {}  
info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}  
info: \<-- GET /wd/hub/status 200 3.230 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}  
info: --\> GET /wd/hub/status {}  
info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}

**NODE CONFIGURATION :** Configured in port 4728

{  
“capabilities”:  
[  
{  
“browserName”: “Android”,  
“version”:“5.0”,  
“maxInstances”: 3,  
“platform”:“ANDROID”,  
“deviceName”:“emulator-5554”  
}  
],  
“configuration”:{  
“cleanUpCycle”:2000,  
“timeout”:30000,  
“proxy”:“org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,  
“url”:“[http://127.0.0.1](http://127.0.0.1): **4728** /wd/hub”,  
“host”:“127.0.0.1”,  
“port”: **4728** ,  
“maxSession”:1,  
“register”:true,  
“registerCycle”:5000,  
“hubPort”:4433,  
“hubHost”:“127.0.0.1”  
}  
}

**SELENIUM GRID CONSOLE :**

java -jar /Users/mselvansr/Downloads/selenium-server-standalone-2.44.0.jar -role hub -port 4433  
22:12:46.889 INFO - Launching a selenium grid server  
2015-01-25 22:12:47.514:INFO:osjs.Server:jetty-7.x.y-SNAPSHOT  
2015-01-25 22:12:47.547:INFO:osjsh.ContextHandler:started o.s.j.s.ServletContextHandler{/,null}  
2015-01-25 22:12:47.553:INFO:osjs.AbstractConnector:Started SocketConnector@0.0.0.0:4433

**Source code for running android emulator :**

DesiredCapabilities capabilities = new DesiredCapabilities();  
File appDir = new File("/Users/mselvansr/Developer");  
File app = new File(appDir, “AndroidPdfViewer\_1\_0\_0b.apk”);  
capabilities.setCapability(MobileCapabilityType.PLATFORM\_NAME,“Android”);  
capabilities.setCapability(MobileCapabilityType.BROWSER\_NAME, “Android”);  
capabilities.setCapability(MobileCapabilityType.DEVICE\_NAME, “emulator-5554”);  
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());  
capabilities.setCapability(MobileCapabilityType.NEW\_COMMAND\_TIMEOUT, 120);  
try {  
**driver = new RemoteWebDriver(new URL(“[http://127.0.0.1:4728/wd/hub](http://127.0.0.1:4728/wd/hub)”), capabilities);**  
} catch (MalformedURLException e) {  
e.printStackTrace();  
}  
driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);  
System.out.println(“App launched”);

**ERROR :**

log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).  
log4j:WARN Please initialize the log4j system properly.  
Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Requested a new session but one was in progress) (WARNING: The server did not provide any stacktrace information)  
Command duration or timeout: 121 milliseconds  
Build info: version: ‘2.43.1’, revision: ‘5163bceef1bc36d43f3dc0b83c88998168a363a0’, time: ‘2014-09-10 09:43:55’  
System info: host: ‘LM-sjn-00877356’, ip: ‘10.244.65.221’, os.name: ‘Mac OS X’, os.arch: ‘x86\_64’, os.version: ‘10.10.1’, java.version: ‘1.7.0\_71’  
Driver info: org.openqa.selenium.remote.RemoteWebDriver  
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)  
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)  
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)  
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)  
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)  
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)  
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)  
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)  
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126)  
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:153)  
at com.paypal.selion.android.sample.AndroidGrid.main(AndroidGrid.java:63)

**COMMAND FOR ADB STATUS -CONNECTED**  
adb devices  
List of devices attached  
emulator-5554 device

**CLARIFICATIONS and NEED SOLUTION PLEASE :**

My grid and node is started successfully and i am passing all the required DesiredCapabilities for starting android emulator then why i am getting this error and not able to start my app in emulator , **HELP ME PLEASE**

---

<div class="post-metadata">

**Author:** ![Hysistia](https://discuss.appium.io/letter_avatar_proxy/v4/letter/h/96bed5/32.png) [@Hysistia](https://discuss.appium.io/u/Hysistia)\
**Post date:** [January 26, 2015, 9:41pm UTC](https://discuss.appium.io/t/error-a-new-session-could-not-be-created-for-android-appium/2571/2 "2015-01-26T21:41:24Z")

</div>

My knowledge only goes so far, but instead of pre-launching the emulator, try setting the `deviceName` in the node config to be the name of the AVD, not the name of the running emulator.

e.g. If you have an AVD named _nexus5_, it may run as emulator-5554, but if you give Appium “nexus5” as the `deviceName` then it should automatically launch and use that AVD without you having to launch the emulator manually.

---

<div class="post-metadata">

**Author:** ![Hysistia](https://discuss.appium.io/letter_avatar_proxy/v4/letter/h/96bed5/32.png) [@Hysistia](https://discuss.appium.io/u/Hysistia)\
**Post date:** [January 26, 2015, 9:43pm UTC](https://discuss.appium.io/t/error-a-new-session-could-not-be-created-for-android-appium/2571/3 "2015-01-26T21:43:59Z")

</div>

There’s also the appium server flag --avd.  
e.g. `appium --avd nexus5`

---

<div class="post-metadata">

**Author:** ![MuthuSelvan](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/779978/32.png) [@MuthuSelvan](https://discuss.appium.io/u/MuthuSelvan)\
**Post date:** [January 27, 2015, 6:47am UTC](https://discuss.appium.io/t/error-a-new-session-could-not-be-created-for-android-appium/2571/4 "2015-01-27T06:47:43Z")

</div>

Hi Hysistia ,

Added the following capabilities but still getting the error

// first is my avd name  
capabilities.setCapability(MobileCapabilityType.DEVICE\_NAME, “first”);

Error :  
Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Requested a new session but one was in progress) (WARNING: The server did not provide any stacktrace information)  
Command duration or timeout: 126 milliseconds  
Build info: version: ‘2.43.1’, revision: ‘5163bceef1bc36d43f3dc0b83c88998168a363a0’, time: ‘2014-09-10 09:43:55’  
System info: host: ‘N/A’, ip: ‘N/A’, os.name: ‘Mac OS X’, os.arch: ‘x86\_64’, os.version: ‘10.10.1’, java.version: ‘1.7.0\_71’  
Driver info: org.openqa.selenium.remote.RemoteWebDriver

**Config File :**

{  
“capabilities”:  
[  
{  
“browserName”: “Android”,  
“version”:“5.0.1”,  
“maxInstances”: 3,  
“platform”:“ANDROID”,  
“deviceName”:“first”  
}  
],  
“configuration”:{  
“cleanUpCycle”:2000,  
“timeout”:30000,  
“proxy”:“org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,  
“url”:“[http://127.0.0.1:4728/wd/hub](http://127.0.0.1:4728/wd/hub)”,  
“host”:“127.0.0.1”,  
“port”:4728,  
“maxSession”:1,  
“register”:true,  
“registerCycle”:5000,  
“hubPort”:4433,  
“hubHost”:“127.0.0.1”  
}  
}

**Confirmation :**

Could you please confirm , What is wrong ? Why my app is not launched ? even device in connected status ?

Thanks ,  
Muthu Selvan SR

---

<div class="post-metadata">

**Author:** ![Hysistia](https://discuss.appium.io/letter_avatar_proxy/v4/letter/h/96bed5/32.png) [@Hysistia](https://discuss.appium.io/u/Hysistia)\
**Post date:** [January 27, 2015, 4:09pm UTC](https://discuss.appium.io/t/error-a-new-session-could-not-be-created-for-android-appium/2571/5 "2015-01-27T16:09:47Z")

</div>

Hi Muthu, if I have time today, I’ll try testing your capabilities and node config on my PC briefly.

---

<div class="post-metadata">

**Author:** ![MuthuSelvan](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/779978/32.png) [@MuthuSelvan](https://discuss.appium.io/u/MuthuSelvan)\
**Post date:** [January 27, 2015, 9:18pm UTC](https://discuss.appium.io/t/error-a-new-session-could-not-be-created-for-android-appium/2571/6 "2015-01-27T21:18:05Z")

</div>

Thanks Hysistia , Appreciate your help !

**FYI , Getting the below log in appium node :**

info: Retrieving device  
info: [debug] Trying to find a connected android device  
info: [debug] Getting connected devices…  
info: [debug] executing cmd: “/usr/local/bin/adb” devices  
info: [debug] 1 device(s) connected  
info: Found device emulator-5554  
info: [debug] Setting device id to emulator-5554  
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)  
info: [debug] executing cmd: “/usr/local/bin/adb” -s emulator-5554 wait-for-device  
info: [debug] executing cmd: “/usr/local/bin/adb” -s emulator-5554 shell “echo ‘ready’”  
info: [debug] Starting logcat capture  
error: Logcat capture failed: spawn ENOENT  
info: [debug] Stopping logcat capture  
info: --\> GET /wd/hub/status {}  
info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}},“sessionId”:“6439590d-f2c5-45af-861a-d92458c15012”}  
info: \<-- GET /wd/hub/status 200 0.591 ms - 155 {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}},“sessionId”:“6439590d-f2c5-45af-861a-d92458c15012”}  
info: --\> GET /wd/hub/status {}

---

<div class="post-metadata">

**Author:** ![MuthuSelvan](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/779978/32.png) [@MuthuSelvan](https://discuss.appium.io/u/MuthuSelvan)\
**Post date:** [January 29, 2015, 1:40am UTC](https://discuss.appium.io/t/error-a-new-session-could-not-be-created-for-android-appium/2571/7 "2015-01-29T01:40:05Z")

</div>

Thanks Hysistia . its working fine after i set correct ANDROID\_HOME in PATH before running the appium …

---

<div class="post-metadata">

**Author:** ![Hysistia](https://discuss.appium.io/letter_avatar_proxy/v4/letter/h/96bed5/32.png) [@Hysistia](https://discuss.appium.io/u/Hysistia)\
**Post date:** [January 29, 2015, 7:57pm UTC](https://discuss.appium.io/t/error-a-new-session-could-not-be-created-for-android-appium/2571/8 "2015-01-29T19:57:19Z")

</div>

You’re welcome; unfortunately I didn’t get around to testing yesterday. I’m glad it’s working! 😄

---

<div class="post-metadata">

**Author:** ![MuthuSelvan](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/779978/32.png) [@MuthuSelvan](https://discuss.appium.io/u/MuthuSelvan)\
**Post date:** [January 30, 2015, 7:20pm UTC](https://discuss.appium.io/t/error-a-new-session-could-not-be-created-for-android-appium/2571/9 "2015-01-30T19:20:02Z")

</div>

Hysistia ,

I am looking your help on my below issue

> [@ERROR when Launching app from URL in ZIP format](https://discuss.appium.io/t/error-when-launching-app-from-url-in-zip-format/2633):
>
> Hi , I am using appium grid for running iOS and android and currently i am using the following absolute path in code for launching the app from path , its working fine ! capabilities.setCapability(“app”,"/Users/mselvansr/grid/InternationalMountains.app"); My question , i want pass this URL or FTP server like or common path ( NOT FROM MY LOCAL ) capabilities.setCapability(“app”, “[http://appium.s3.amazonaws.com/TestApp6.0.app.zip](http://appium.s3.amazonaws.com/TestApp6.0.app.zip)”); I ran the below example code from URL but its throwing the e…

---

<div class="post-metadata">

**Author:** ![MS](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/e47c2d/32.png) [@MS](https://discuss.appium.io/u/MS)\
**Post date:** [October 2, 2015, 9:22pm UTC](https://discuss.appium.io/t/error-a-new-session-could-not-be-created-for-android-appium/2571/10 "2015-10-02T21:22:40Z")

</div>

I am having the same issue trying to run on Android emulator. My ANDROID\_HOME is set correctly. Appium Inspector can launch the app properly, but cannot run tests from terminal. Would appreciate your help.

mahvish:imoji mahvish$ CAP=capabilities.android.testing behave  
2015-10-02 17:19:48.817076:FBLoginWeb: \*\*\*\* Inside fb login web view setting cancel  
2015-10-02 17:19:48.842771:before\_all{‘context’: \<behave.runner.Context object at 0x10c788d90\>}:None  
@debuglogin  
Feature: Login with Email # features/debuglogin.feature:3  
As email-registered user  
I want to login  
so that I can use the app2015-10-02 17:19:48.844196:connect:remote with:{‘appPackage’: ‘com.bitstrips.imoji.testing’, ‘autoLaunch’: True, ‘platformName’: ‘Android’, ‘deviceName’: ‘Android’}  
Traceback (most recent call last):  
File “/usr/local/bin/behave”, line 8, in   
load\_entry\_point(‘behave==1.2.4’, ‘console\_scripts’, ‘behave’)()  
File “build/bdist.macosx-10.9-intel/egg/behave/ **main**.py”, line 111, in main  
File “build/bdist.macosx-10.9-intel/egg/behave/runner.py”, line 659, in run  
File “build/bdist.macosx-10.9-intel/egg/behave/runner.py”, line 680, in run\_with\_paths  
File “build/bdist.macosx-10.9-intel/egg/behave/runner.py”, line 481, in run\_model  
File “build/bdist.macosx-10.9-intel/egg/behave/model.py”, line 447, in run  
File “build/bdist.macosx-10.9-intel/egg/behave/runner.py”, line 403, in run\_hook  
File “/Users/mahvish/src/disco/imoji/features/environment.py”, line 38, in before\_feature  
context.app.connect()  
File “features/steps/support/app.py”, line 16, in connect  
self.wd = webdriver.Remote(‘[http://127.0.0.1:4723/wd/hub](http://127.0.0.1:4723/wd/hub)’, self.capabilities)  
File “build/bdist.macosx-10.10-intel/egg/appium/webdriver/webdriver.py”, line 35, in **init**  
File “/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py”, line 73, in **init**  
self.start\_session(desired\_capabilities, browser\_profile)  
File “/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py”, line 121, in start\_session  
‘desiredCapabilities’: desired\_capabilities,  
File “/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py”, line 173, in execute  
self.error\_handler.check\_response(response)  
File “/Library/Python/2.7/site-packages/selenium/webdriver/remote/errorhandler.py”, line 164, in check\_response  
raise exception\_class(message, screen, stacktrace)  
selenium.common.exceptions.WebDriverException: Message: u’A new session could not be created. (Original error: spawn “/usr/local/bin/adb” ENOENT)’  
mahvish:imoji mahvish$

---

<div class="post-metadata">

**Author:** ![Akshay](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/3ab097/32.png) [@Akshay](https://discuss.appium.io/u/Akshay)\
**Post date:** [June 18, 2016, 5:37pm UTC](https://discuss.appium.io/t/error-a-new-session-could-not-be-created-for-android-appium/2571/11 "2016-06-18T17:37:19Z")

</div>

HI All,

I am getting below error while trying to run below appium code.Checked all possible solutions but not getting it resolved.:-

ERROR

Exception in thread “main” org.openqa.selenium.remote.SessionNotFoundException:  
Command duration or timeout: 610 milliseconds  
Build info: version: ‘2.53.0’, revision: ‘35ae25b’, time: ‘2016-03-15 17:00:58’  
System info: host: ‘INDC5WWGY1’, ip: ‘10.135.161.85’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.7.0\_67’  
Session ID: eaffbafa14995946ea8e119fb1539160  
Driver info: io.appium.java\_client.android.AndroidDriver  
Capabilities [{platform=ANDROID, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={}, rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, version=44.0.2403.119, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, hasTouchScreen=true, applicationCacheEnabled=false, takesScreenshot=true}]  
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)  
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)  
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)  
at java.lang.reflect.Constructor.newInstance(Unknown Source)  
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)  
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)  
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)  
at io.appium.java\_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:51)  
at io.appium.java\_client.AppiumDriver.execute(AppiumDriver.java:268)  
at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:526)  
at appium.My.main(My.java:38)

Please do someone quote on this for below code :

Code

package appium;

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

import org.openqa.selenium.By;  
import org.openqa.selenium.WebDriver;  
import org.openqa.selenium.WebElement;  
import org.openqa.selenium.remote.DesiredCapabilities;  
import org.openqa.selenium.remote.RemoteWebDriver;  
import org.testng.Assert;

import io.appium.java\_client.android.AndroidDriver;  
import io.appium.java\_client.remote.MobileBrowserType;  
import io.appium.java\_client.remote.MobileCapabilityType;

public class My {

```
            public static void main(String[] args) throws MalformedURLException {
                            // TODO Auto-generated method stub
                            AndroidDriver driver;

                            DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("deviceName", "Nexus 5");
    capabilities.setCapability("platformName", "android");
    capabilities.setCapability("platformVersion", "5.0.1");
    
    
      capabilities.setCapability("appPackage","com.android.calculator2");
      capabilities.setCapability("appActivity","com.android.calculator2.Calculator");
                           
    
    driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
   
    driver.quit();

            }
```

---

<div class="post-metadata">

**Author:** ![santhosh](https://discuss.appium.io/letter_avatar_proxy/v4/letter/s/f07891/32.png) [@santhosh](https://discuss.appium.io/u/santhosh)\
**Post date:** [June 24, 2016, 7:16am UTC](https://discuss.appium.io/t/error-a-new-session-could-not-be-created-for-android-appium/2571/12 "2016-06-24T07:16:15Z")

</div>

Hi,

Even I have this issue how to fix it?

---

<div class="post-metadata">

**Author:** ![mikaziknight](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/eb8c5e/32.png) [@mikaziknight](https://discuss.appium.io/u/mikaziknight)\
**Post date:** [February 20, 2017, 7:25pm UTC](https://discuss.appium.io/t/error-a-new-session-could-not-be-created-for-android-appium/2571/14 "2017-02-20T19:25:36Z")

</div>

I had similar issue and i got it fixed with

1\> Make sure **“PORT”** address is the same in

- Appium General Settings

- in Code  
AndroidDriver driver = new AndroidDriver(new URL(“[http://127.0.0.1:4732/wd/hub](http://127.0.0.1:4732/wd/hub)”),cap );

2\> Make sure **Device name** in **adb devices** and **in Appium settings** are the same

example -  
in adb devices : -  
user adb devices  
List of devices attached  
**emulator-5554** device

in Appium :-  
Device Name = **emulator-5554**
