Unable to execute code on Android 7.0

error: Failed to start an Appium session, err was: Error: Command failed: Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]

info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
info: [debug] Error: Command failed: Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]

at ChildProcess.exithandler (child_process.js:637:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)

info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Command failed: Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]\r\n)”,“killed”:false,“code”:1,“signal”:null,“origValue”:“Command failed: Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]\r\n”},“sessionId”:null}
info: ← POST /wd/hub/session 500 10158.475 ms - 654

@ranjit_nayak try Uninstall! appium programs from phone and retry. With Android 7.0 you can disable program which makes such issue. Do uninstall of it instead.

1 Like

@Aleksei, Thanks for your reply. But if i uninstall, how can i execute my code on same phone connected?

Will it work?

@ranjit_nayak it will just install it back on driver start (but it cannot in case of app is disabled by user). with Android 7+ always UNINSTALL app if you need. not disable.

@Aleksei,
I am just a beginner for this appium, so have little less idea. I can see something on my phone, that shows Unlock and Appium Settings.

So just wanted to know how can i uninstall this and which one.

@ranjit_nayak like any program on Android phone in App manager.

@Aleksei, you mean i need to remove completely from the phone below 2 items?

Unlock icon
and Appium Settings icon

@ranjit_nayak yes. remove them.

@Aleksei, Thanks, lts c.

@Aleksei, no luck agian. nothing worked

@ranjit_nayak check in USB menu option “check harmfull behavior for USB”. disable it. i met with this on some phone. just another suggestion.

@Aleksei Getting below console error now:

Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Command failed: ) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 13.19 seconds
Build info: version: ‘2.53.0’, revision: ‘35ae25b1534ae328c771e0856c93e187490ca824’, time: ‘2016-03-15 10:43:46’
System info: host: ‘admin-PC’, ip: ‘192.168.1.9’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_101’
Driver info: io.appium.java_client.android.AndroidDriver
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.AppiumDriver.execute(AppiumDriver.java:180)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:158)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:109)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:39)
at Day2Class.Drag_Drop_remove.main(Drag_Drop_remove.java:29)

@ranjit_nayak lets’ start from begining :slight_smile:

  1. appium version
  2. java-client version
  3. add appium logs
  4. how you starting appium