question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Appium failed to create driver for native browser

See original GitHub issue

Here is the code snippet

@Before public void setUp() throws Exception { DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(“deviceName”, “emulator-5554”); capabilities.setCapability(“platformName”, “Android”); capabilities.setCapability(“platformVersion”, “4.4”); capabilities.setCapability(“browserName”, “Browser”); driver = new AndroidDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities); }

Appium was not able to complete setup and waited for the execution of

   driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),
            capabilities);

Here is the server stack trace:

info: Welcome to Appium v1.4.3 (REV a357c7fa73222315dd85c3d2dd8334767cca1b0d) info: Appium REST http interface listener started on 0.0.0.0:4723 info: Console LogLevel: debug info: --> POST /wd/hub/session {“desiredCapabilities”:{“platformVersion”:“4.4”,“deviceName”:“emulator-5554”,“platformName”:“Android”,“browserName”:“Browser”}} info: Client User-Agent string: Apache-HttpClient/4.3.3 (java 1.5) info: Set mode: Proxying straight through to Chromedriver info: [debug] Looks like we want chrome on android info: [debug] Creating new appium session b8fb6fac-e3de-41cb-8d0d-f045c503195e info: [debug] Checking whether adb is present info: [debug] Using adb from /home/spartans/.linuxbrew/Cellar/android-sdk/24.2/platform-tools/adb info: [debug] Using fast reset? true 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: /home/spartans/.linuxbrew/Cellar/android-sdk/24.2/platform-tools/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: /home/spartans/.linuxbrew/Cellar/android-sdk/24.2/platform-tools/adb -s emulator-5554 wait-for-device info: [debug] executing cmd: /home/spartans/.linuxbrew/Cellar/android-sdk/24.2/platform-tools/adb -s emulator-5554 shell “echo ‘ready’” info: [debug] Starting logcat capture info: [debug] Pushing unlock helper app to device… info: [debug] executing cmd: /home/spartans/.linuxbrew/Cellar/android-sdk/24.2/platform-tools/adb -s emulator-5554 install “/home/spartans/.linuxbrew/lib/node_modules/appium/build/unlock_apk/unlock_apk-debug.apk” info: [debug] executing cmd: /home/spartans/.linuxbrew/Cellar/android-sdk/24.2/platform-tools/adb -s emulator-5554 shell “dumpsys window” info: [debug] Screen already unlocked, continuing. info: [debug] Forwarding system:4724 to device:4724 info: [debug] executing cmd: /home/spartans/.linuxbrew/Cellar/android-sdk/24.2/platform-tools/adb -s emulator-5554 forward tcp:4724 tcp:4724 info: [debug] Pushing appium bootstrap to device… info: [debug] executing cmd: /home/spartans/.linuxbrew/Cellar/android-sdk/24.2/platform-tools/adb -s emulator-5554 push “/home/spartans/.linuxbrew/lib/node_modules/appium/build/android_bootstrap/AppiumBootstrap.jar” /data/local/tmp/ info: Starting App info: [debug] Attempting to kill all ‘uiautomator’ processes info: [debug] Getting all processes with ‘uiautomator’ info: [debug] executing cmd: /home/spartans/.linuxbrew/Cellar/android-sdk/24.2/platform-tools/adb -s emulator-5554 shell “ps ‘uiautomator’” info: [debug] No matching processes found info: [debug] Running bootstrap info: [debug] spawning: /home/spartans/.linuxbrew/Cellar/android-sdk/24.2/platform-tools/adb -s emulator-5554 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.android.browser -e disableAndroidWatchers false info: [debug] [UIAUTOMATOR STDOUT] WARNING: linker: info: [debug] [UIAUTOMATOR STDOUT] libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix. info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream= info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap: info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1 info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1 info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724 info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready info: [debug] [BOOTSTRAP] [debug] Loading json… info: [debug] [BOOTSTRAP] [debug] Registered crash watchers. info: [debug] Pushing command to appium work queue: [“getDataDir”,{}] info: [debug] [BOOTSTRAP] [debug] Client connected info: [debug] dataDir set to: /data error: Unhandled error: TypeError: undefined is not a function at [object Object].ChromeAndroid.createSession (/home/spartans/.linuxbrew/lib/node_modules/appium/lib/devices/android/chrome.js:154:33) at /home/spartans/.linuxbrew/lib/node_modules/appium/node_modules/async/lib/async.js:607:21 at /home/spartans/.linuxbrew/lib/node_modules/appium/node_modules/async/lib/async.js:246:17 at iterate (/home/spartans/.linuxbrew/lib/node_modules/appium/node_modules/async/lib/async.js:146:13) at /home/spartans/.linuxbrew/lib/node_modules/appium/node_modules/async/lib/async.js:157:25 at /home/spartans/.linuxbrew/lib/node_modules/appium/node_modules/async/lib/async.js:248:21 at /home/spartans/.linuxbrew/lib/node_modules/appium/node_modules/async/lib/async.js:612:34 at [object Object].<anonymous> (/home/spartans/.linuxbrew/lib/node_modules/appium/lib/devices/android/android.js:541:5) at next (/home/spartans/.linuxbrew/lib/node_modules/appium/node_modules/async/lib/async.js:798:43) at /home/spartans/.linuxbrew/lib/node_modules/appium/node_modules/async/lib/async.js:32:16 at [object Object].exports.respond (/home/spartans/.linuxbrew/lib/node_modules/appium/lib/devices/common.js:28:9) at [object Object].<anonymous> (/home/spartans/.linuxbrew/lib/node_modules/appium/lib/devices/android/android.js:507:16) at [object Object].<anonymous> (/home/spartans/.linuxbrew/lib/node_modules/appium/lib/devices/android/uiautomator.js:95:9) at Socket.emit (events.js:107:17) at readableAddChunk (_stream_readable.js:163:16) at Socket.Readable.push (_stream_readable.js:126:10) at TCP.onread (net.js:538:20) context: [POST /wd/hub/session {“desiredCapabilities”:{“platformVersion”:“4.4”,“deviceName”:“emulator-5554”,“platformName”:“Android”,“browserName”:“Browser”}}] info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“getDataDir”,“params”:{}} info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:“/data”,“status”:0} info: Chromedriver: Set chromedriver binary as: /home/spartans/.linuxbrew/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/linux/chromedriver_64 info: Chromedriver: Killing any old chromedrivers, running: ps -ef | grep /home/spartans/.linuxbrew/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/linux/chromedriver_64 | grep -v grep |grep -e ‘–port=9515(\s.*)?$’ | awk ‘{ print $2 }’ | xargs kill -15 info: Chromedriver: Successfully cleaned up old chromedrivers info: Chromedriver: Spawning chromedriver with: /home/spartans/.linuxbrew/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/linux/chromedriver_64 --url-base=wd/hub --port=9515 info: Chromedriver: [STDOUT] Starting ChromeDriver 2.16.333243 (0bfa1d3575fc1044244f21ddb82bf870944ef961) on port 9515 Only local connections are allowed. info: JSONWP Proxy: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body info: JSONWP Proxy: Got response with status 200: {“sessionId”:“”,“status”:0,“value”:{“build”:{“version”:“alpha”},“os”:{“arch”:“x86_64”,“name”:“Linux”,“version”:“3.13.0-43-generic”}}} info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {“desiredCapabilities”:{“chromeOptions”:{“androidPackage”:“com.android.browser”,“androidActivity”:“com.android.browser.BrowserActivity”,“androidDeviceSerial”:“emulator-5554”}}} info: JSONWP Proxy: Got response with status 200: {“sessionId”:“cb9851250eff725dc5cd5faae8d5fa8b”,“status”:0,“value”:{“acceptSslCerts”:true,“applicationCacheEnabled”:false,“browserConnectionEnabled”:false,“browserName”:“chrome”,“chrome”:{},"cssSelect…

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
imurchiecommented, Nov 8, 2016

@laisportugal Can you create a new issue with your particular details? This one is so old that the particulars are almost certainly different.

0reactions
lock[bot]commented, Apr 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not start a new session. Possible causes are invalid ...
I run at first the appium server and after i excute the code and i have this error i ignored the cause package...
Read more >
Appium error connecting android device - Support
Hi, I am getting the following error log on Appium server, when running test script on Eclipse.. C:\Appium\node_modules\appium\bin>node appium.js info: ...
Read more >
Unable to start session from appium inspector - Issues/Bugs
I am getting error message when I try to start the session in Appium ... If you are using the browser version, also...
Read more >
Troubleshooting - Appium
Go to Window -> Devices, and it should start automatically. This is needed after iOS version upgrades. If you see iOS Simulator failed...
Read more >
Getting A new session could not be created. error - Support
Driver info: io.appium.java_client.AppiumDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found