Encountered internal error running command: Error: 'app' option is required for reinstall

Please also help how can I install ‘com.android.chrome’ on my android emulator. I have enabled some of my settings on Android SDK. But still it is not install on my emulator device.

Kindly assist. Thank you in advance.

import java.net.MalformedURLException;

import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.testng.Assert;

import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;

public class browse extends baseChrome {

	public static void main(String[] args) throws MalformedURLException {
		// TODO Auto-generated method stub
		
		AndroidDriver<AndroidElement> driver  = capabilities();

		driver.get("https://rahulshettyacademy.com/angularAppdemo/");

		driver.findElement(By.cssSelector(".navbar-toggler")).click();

		driver.findElement(By.cssSelector("a[href*='products']")).click();

		JavascriptExecutor js= (JavascriptExecutor)driver;

		js.executeScript("window.scrollBy(0,1000)", "");

		String text =driver.findElement(By.xpath("(//li[@class='list-group-item'])[3]/div/div/a")).getText();

		Assert.assertEquals(text, "Devops");

	}

}

APPIUM LOGS

C:\Users\kristine.moreno>appium
[Appium] Welcome to Appium v1.22.2
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[debug] [HTTP] Request idempotency key: c6b313e3-62b9-4d75-b0d7-33589d8ff9a5
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"automationName":"uiautomator2","browserName":"Chrome","appium:chromeOptions":{"w3c":false},"platformName":"Android","deviceName":"KristineEmulator"},"capabilities":{"firstMatch":[{"appium:chromeOptions":{"w3c":false},"appium:automationName":"uiautomator2","browserName":"Chrome","appium:deviceName":"KristineEmulator","platformName":"android"}]}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"automationName":"uiautomator2","browserName":"Chrome","appium:chromeOptions":{"w3c":false},"platformName":"Android","deviceName":"KristineEmulator"},null,{"firstMatch":[{"appium:chromeOptions":{"w3c":false},"appium:automationName":"uiautomator2","browserName":"Chrome","appium:deviceName":"KristineEmulator","platformName":"android"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1646636519398 (15:01:59 GMT+0800 (Taipei Standard Time))
[Appium] Appium v1.22.2 creating new AndroidUiautomator2Driver (v1.70.1) session
[debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver]   "alwaysMatch": {
[debug] [BaseDriver]     "browserName": "Chrome",
[debug] [BaseDriver]     "platformName": "android",
[debug] [BaseDriver]     "appium:chromeOptions": {
[debug] [BaseDriver]       "w3c": false
[debug] [BaseDriver]     },
[debug] [BaseDriver]     "appium:automationName": "uiautomator2",
[debug] [BaseDriver]     "appium:deviceName": "KristineEmulator"
[debug] [BaseDriver]   },
[debug] [BaseDriver]   "firstMatch": [
[debug] [BaseDriver]     {}
[debug] [BaseDriver]   ]
[debug] [BaseDriver] }
[BaseDriver] Session created with session id: 50dcda45-d62a-4547-9fa5-0e2a050193d4
[UiAutomator2] We're going to run a Chrome-based session
[UiAutomator2] Chrome-type package and activity are com.android.chrome and com.google.android.apps.chrome.Main
[UiAutomator2] Starting 'com.android.chrome' directly on the device
[ADB] Found 3 'build-tools' folders under 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk' (newest first):
[ADB]     C:/Users/kristine.moreno/AppData/Local/Android/Sdk/build-tools/32.1.0-rc1
[ADB]     C:/Users/kristine.moreno/AppData/Local/Android/Sdk/build-tools/32.0.0
[ADB]     C:/Users/kristine.moreno/AppData/Local/Android/Sdk/build-tools/30.0.3
[ADB] Using 'adb.exe' from 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe'
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server'
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices
[debug] [ADB] Connected devices: [{"udid":"emulator-5554","state":"device"}]
[AndroidDriver] Using device: emulator-5554
[ADB] Using 'adb.exe' from 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe'
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server'
[debug] [ADB] Setting device id to emulator-5554
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk'
[debug] [ADB] Current device property 'ro.build.version.sdk': 30
[ADB] Getting device platform version
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.release'
[debug] [ADB] Current device property 'ro.build.version.release': 11
[debug] [ADB] Device API level: 30
[UiAutomator2] Relaxing hidden api policy
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'settings put global hidden_api_policy_pre_p_apps 1;settings put global hidden_api_policy_p_apps 1;settings put global hidden_api_policy 1''
[AndroidDriver] No app sent in, not parsing package/activity
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 wait-for-device'
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell echo ping'
[debug] [AndroidDriver] Pushing settings apk to device...
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
[debug] [ADB] 'io.appium.settings' is installed
[debug] [ADB] Getting package info for 'io.appium.settings'
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
[debug] [ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('3.4.0' >= '3.4.0')
[debug] [ADB] There is no need to install/upgrade 'C:\Users\kristine.moreno\AppData\Roaming\npm\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk'
[debug] [ADB] Getting IDs of all 'io.appium.settings' processes
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'pgrep --help; echo $?''
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f \(\[\[:blank:\]\]\|\^\)io\.appium\.settings\(\[\[:blank:\]\]\|\$\)'
[debug] [ADB] Getting IDs of all 'io.appium.settings' processes
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f \(\[\[:blank:\]\]\|\^\)io\.appium\.settings\(\[\[:blank:\]\]\|\$\)'
[debug] [ADB] Starting Appium Settings app
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER'
[debug] [ADB] Getting IDs of all 'io.appium.settings' processes
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f \(\[\[:blank:\]\]\|\^\)io\.appium\.settings\(\[\[:blank:\]\]\|\$\)'
[debug] [Logcat] Starting logs capture with command: C:\\Users\\kristine.moreno\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 logcat -v threadtime
[debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to local port 8200
[debug] [ADB] Forwarding system: 8200 to device: 6790
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward tcp:8200 tcp:6790'
[debug] [ADB] Getting install status for io.appium.uiautomator2.server
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server'
[debug] [ADB] 'io.appium.uiautomator2.server' is installed
[debug] [ADB] Getting package info for 'io.appium.uiautomator2.server'
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server'
[debug] [ADB] The version name of the installed 'io.appium.uiautomator2.server' is greater or equal to the application version name ('4.27.0' >= '4.27.0')
[debug] [UiAutomator2] io.appium.uiautomator2.server installation state: sameVersionInstalled
[debug] [ADB] Checking app cert for C:\Users\kristine.moreno\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.27.0.apk
[ADB] Using 'apksigner.jar' from 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\build-tools\32.1.0-rc1\lib\apksigner.jar'
[debug] [ADB] Starting apksigner: 'C:\\Program Files (x86)\\Java\\jdk1.8.0_311\\bin\\java.exe' -Xmx1024M -Xss1m -jar C:\\Users\\kristine.moreno\\AppData\\Local\\Android\\Sdk\\build-tools\\32.1.0-rc1\\lib\\apksigner.jar verify --print-certs C:\\Users\\kristine.moreno\\AppData\\Roaming\\npm\\node_modules\\appium\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-v4.27.0.apk
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: [email protected], CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[debug] [ADB]
[debug] [ADB] sha256 hash did match for 'appium-uiautomator2-server-v4.27.0.apk'
[ADB] 'C:\Users\kristine.moreno\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.27.0.apk' is signed with the default certificate
[debug] [ADB] Getting install status for io.appium.uiautomator2.server.test
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server.test'
[debug] [ADB] 'io.appium.uiautomator2.server.test' is installed
[debug] [ADB] Checking app cert for C:\Users\kristine.moreno\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk
[debug] [ADB] Starting apksigner: 'C:\\Program Files (x86)\\Java\\jdk1.8.0_311\\bin\\java.exe' -Xmx1024M -Xss1m -jar C:\\Users\\kristine.moreno\\AppData\\Local\\Android\\Sdk\\build-tools\\32.1.0-rc1\\lib\\apksigner.jar verify --print-certs C:\\Users\\kristine.moreno\\AppData\\Roaming\\npm\\node_modules\\appium\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-debug-androidTest.apk
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: [email protected], CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[debug] [ADB]
[debug] [ADB] sha256 hash did match for 'appium-uiautomator2-server-debug-androidTest.apk'
[ADB] 'C:\Users\kristine.moreno\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' is signed with the default certificate
[UiAutomator2] Server packages are not going to be (re)installed
[debug] [UiAutomator2] Waiting up to 30000ms for services to be available
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list instrumentation'
[debug] [UiAutomator2] Instrumentation target 'io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner' is available
[ADB] Adding packages ["io.appium.settings","io.appium.uiautomator2.server","io.appium.uiautomator2.server.test"] to Doze whitelist
[debug] [ADB] Got the following command chunks to execute: [["dumpsys","deviceidle","whitelist","+io.appium.settings",";","dumpsys","deviceidle","whitelist","+io.appium.uiautomator2.server",";","dumpsys","deviceidle","whitelist","+io.appium.uiautomator2.server.test",";"]]
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys deviceidle whitelist +io.appium.settings ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server.test ;'
[debug] [UiAutomator2] No app capability. Assuming it is already on the device
[debug] [ADB] Getting install status for com.android.chrome
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package com.android.chrome'
[debug] [ADB] 'com.android.chrome' is not installed
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[debug] [WD Proxy] Matched '/' to command name 'deleteSession'
[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 8200
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward --remove tcp:8200'
[UiAutomator2] Restoring hidden api policy to the device default configuration
[debug] [ADB] Running 'C:\Users\kristine.moreno\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy''
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1646636525788 (15:02:05 GMT+0800 (Taipei Standard Time))
[debug] [W3C] Encountered internal error running command: Error: 'app' option is required for reinstall
[debug] [W3C]     at Object.resetApp (C:\Users\kristine.moreno\AppData\Roaming\npm\node_modules\appium\node_modules\appium-android-driver\lib\android-helpers.js:405:11)
[debug] [W3C]     at AndroidUiautomator2Driver.initAUT (C:\Users\kristine.moreno\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:546:9)
[debug] [W3C]     at AndroidUiautomator2Driver.startUiAutomator2Session (C:\Users\kristine.moreno\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:408:5)
[debug] [W3C]     at AndroidUiautomator2Driver.createSession (C:\Users\kristine.moreno\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-driver\lib\driver.js:229:7)
[debug] [W3C]     at AppiumDriver.createSession (C:\Users\kristine.moreno\AppData\Roaming\npm\node_modules\appium\lib\appium.js:387:35)
[HTTP] <-- POST /wd/hub/session 500 6486 ms - 657
[HTTP]