Chrome opens and closes immediately

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, “chrome”);
capabilities.setCapability(“deviceName”, “Testing device”);
capabilities.setCapability(“platformVersion”, “5.0”);
capabilities.setCapability(“platformName”, “Android”);
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 7200);

AndroidDriver aDriver = new AndroidDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities);
aDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
aDriver.get(“https://www.google.com”);

Appium Log -

[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running /Users/yash/android-sdk-macosx/platform-tools/adb with args: ["-P",5037,"-s",“4d0086e6b8bd908f”,“shell”,“dumpsys”,“window”]
[AndroidDriver] Screen already unlocked, doing nothing
[debug] [AndroidBootstrap] Watching for bootstrap disconnect
[debug] [ADB] Forwarding system: 4724 to device: 4724
[debug] [ADB] Running /Users/yash/android-sdk-macosx/platform-tools/adb with args: ["-P",5037,"-s",“4d0086e6b8bd908f”,“forward”,“tcp:4724”,“tcp:4724”]
[debug] [UiAutomator] Starting UiAutomator
[debug] [UiAutomator] Moving to state ‘starting’
[debug] [UiAutomator] Parsing uiautomator jar
[debug] [UiAutomator] Found jar name: ‘AppiumBootstrap.jar’
[debug] [ADB] Running /Users/yash/android-sdk-macosx/platform-tools/adb with args: ["-P",5037,"-s",“4d0086e6b8bd908f”,“push”,"/usr/local/lib/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-android-bootstrap/bootstrap/bin/AppiumBootstrap.jar","/data/local/tmp/"]
[debug] [ADB] Attempting to kill all uiautomator processes
[debug] [ADB] Getting all processes with uiautomator
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running /Users/yash/android-sdk-macosx/platform-tools/adb with args: ["-P",5037,"-s",“4d0086e6b8bd908f”,“shell”,“ps”,“uiautomator”]
[ADB] No uiautomator process found to kill, continuing…
[debug] [UiAutomator] Starting UIAutomator
[debug] [ADB] Creating ADB subprocess with args: -P, 5037, -s, 4d0086e6b8bd908f, shell, uiautomator, runtest, AppiumBootstrap.jar, -c, io.appium.android.bootstrap.Bootstrap, -e, pkg, com.android.chrome, -e, disableAndroidWatchers, false, -e, acceptSslCerts, false
[debug] [UiAutomator] Moving to state ‘online’
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Loading json…
[AndroidBootstrap] Android bootstrap socket is now connected
[AndroidDriver] Starting a chrome-based browser session
[debug] [Chromedriver] Changed state to ‘starting’
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] json loading complete.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected
[Chromedriver] Set chromedriver binary as: /usr/local/lib/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver
[Chromedriver] Killing any old chromedrivers, running: pkill -15 -f “/usr/local/lib/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver.*–port=9515”
[Chromedriver] No old chromedrivers seemed to exist
[Chromedriver] Spawning chromedriver with: /usr/local/lib/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver --url-base=wd/hub --port=9515 --adb-port=5037
[Chromedriver] [STDOUT] Starting ChromeDriver 2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4) on port 9515
Only local connections are allowed.
[JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
[Chromedriver] [STDERR] [warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[JSONWP Proxy] Got response with status 200: “{“sessionId”:”","stat…
[JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {“desiredCapabilities”:{"ch…
[JSONWP Proxy] Got response with status 200: {“sessionId”:"ac1e86e4be4de…
[debug] [Chromedriver] Changed state to ‘online’
[Appium] New AndroidDriver session created successfully, session aaacb182-5f6f-48aa-8472-a7c835542b16 added to master session list
[MJSONWP] Responding to client with driver.createSession() result: {“platform”:“LINUX”,"webSto…
[HTTP] <-- POST /wd/hub/session 200 27104 ms - 597
[HTTP] --> POST /wd/hub/session/aaacb182-5f6f-48aa-8472-a7c835542b16/timeouts {“type”:“implicit”,“ms”:10000}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[JSONWP Proxy] Proxying [POST /wd/hub/session/aaacb182-5f6f-48aa-8472-a7c835542b16/timeouts] to [POST http://127.0.0.1:9515/wd/hub/session/ac1e86e4be4de2c1b40752aa68b7f76f/timeouts] with body: {“type”:“implicit”,“ms”:10000}
[JSONWP Proxy] Got response with status 200: {“sessionId”:"ac1e86e4be4de…
[JSONWP Proxy] Replacing sessionId ac1e86e4be4de2c1b40752aa68b7f76f with aaacb182-5f6f-48aa-8472-a7c835542b16
[HTTP] <-- POST /wd/hub/session/aaacb182-5f6f-48aa-8472-a7c835542b16/timeouts 200 11 ms - 220 .

Try getting the latest Chromedriver for Appium and replace the old driver

npm install appium-chromedriver

copy the chromedriver from npm location to Appium installation location