Support version Android N

@Bhuvnesh

Upgrade your Appium 1.6.3 it will work.

Hi Pradeep,

I am already using an updated version - 1.4.16.1 Further it shows no update.

Thankyou
Bhuvnesh

Hi harigovind ,

i am getting following error can you please help me?

Appium error:
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "C:\Users\sama\AppData\Local\Android\sdk\platform-tools\adb.exe -s ZY223Q2RQ4 install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk""\nFailed 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,“cmd”:“C:\WINDOWS\system32\cmd.exe /s /c "C:\Users\sama\AppData\Local\Android\sdk\platform-tools\adb.exe -s ZY223Q2RQ4 install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk""”,“origValue”:“Command failed: C:\WINDOWS\system32\cmd.exe /s /c "C:\Users\sama\AppData\Local\Android\sdk\platform-tools\adb.exe -s ZY223Q2RQ4 install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk""\nFailed 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 10006.968 ms - 1375

Error in eclips:
new session could not be created. (Original error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c “C:\Users\sama\AppData\Local\Android\sdk\platform-tools\adb.exe -s ZY223Q2RQ4 install “C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk””
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.]
) (WARNING: The server did not provide any stacktrace information)

This is code:
DesiredCapabilities capabilities=new DesiredCapabilities();
capabilities.setCapability(“deviceName”,“Moto G (4)”);
capabilities.setCapability(“platformVersion”,“7.0”);
capabilities.setCapability(“platformName”,“Android”);
capabilities.setCapability(“appPackage”,“com.whatsapp”);
capabilities.setCapability(“appActivity”,“com.whatsapp.Main”);

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

please help me for solving this issue.

Thanks.

Hi,
did you get your problem solved? I received same error message. Please help …

Hi,

No luck yet !!

Configuration:

Machine OS: Windows 7
Appium: 1.4.16.1

Apply same change instructed by @Manasa_Kashyap

try to install 1.6.3 from comman line

install 1.6.3 from comman line

I tried to uninstall Appium_Settings / Unlock before starting Appium, it bypass this error [Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]]

but facing another error [error: Failed to start an Appium session, err was: Error: Command failed: C:\Win
dows\system32\cmd.exe /s /c “C:\Users\xxx\AppData\Local\Android\sdk\platfor
m-tools\adb.exe -s ac51daff shell “ps ‘uiautomator’””]

then apply changes instructed by Manasa_Kashyap

a new session successfully created!

hope it helps, good luck!

Machine OS: Windows Server 2008 R2
Appium: 1.4.16.1

thanks to @willosser @Manasa_Kashyap

Does anyone know how to uninstall Appium_Settings.apk and Unlock.apk programmatically vs. manually run cmd every time?

2 Likes

We have our own adb library which includes a method to uninstall the app. This won’t work if you are using a device farm (e.g. BitBar, SauceLabs) because they don’t give you access to adb (and rightfully so, they want to protect their devices from malicious or unintentional hazardous actions). If you are testing your device in house, though, you can use this solution.

Alternately, you can dig through appium and enhance their interfaces so it uninstalls the app before installing if using Appium N

1 Like

@samadhan_kolhe have you tried this ? It should solve that error

1.6.3 should have a fix for it though.

Thanks @Donna @Manasa_Kashyap

2 Likes

Hello ,

Thank you so much.Its working.Thanks for your help.

I get the test phone connected to my dev machine. could you please share your customized uninstall the app method in adb library? Appreciate your help, thanks!

It’s not terribly complex – we execute the command ‘adb -s uninstall <app_name>’

You can obtain the uuid by parsing the output of adb devices in a similar fashion to what appium does.

What’s more interesting is setting up an adb class that can be used as necessary.

While installing appium from command prompt getting below error

C:\Windows\System32>npm install -g appium
C:\Users\tecdvp3\AppData\Roaming\npm\appium → C:\Users\tecdvp3\AppData\Roaming
npm\node_modules\appium\build\lib\main.js

[email protected] install C:\Users\tecdvp3\AppData\Roaming\npm\node_modules\appium
\node_modules\sqlite3
node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(undefined): https://mapbox-node-binary.s3.am
azonaws.com/sqlite3/v3.1.8/node-v51-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected]
(node-v51 ABI) (falling back to source compile with node-gyp)
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: unable to get local issuer certificate
gyp ERR! stack at TLSSocket. (_tls_wrap.js:1088:38)
gyp ERR! stack at emitNone (events.js:86:13)
gyp ERR! stack at TLSSocket.emit (events.js:188:7)
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:610:8)
gyp ERR! stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\tecdvp3\AppD
ata\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js” “configure” “–fall
back-to-build” “–module=C:\Users\tecdvp3\AppData\Roaming\npm\node_modules
\appium\node_modules\sqlite3\lib\binding\node-v51-win32-x64\node_sqlite3.
node” “–module_name=node_sqlite3” “–module_path=C:\Users\tecdvp3\AppData\R
oaming\npm\node_modules\appium\node_modules\sqlite3\lib\binding\node-v51
-win32-x64” “–python=C:\Users\tecdvp3\.windows-build-tools\python27\python
.exe” “–msvs_version=2015”
gyp ERR! cwd C:\Users\tecdvp3\AppData\Roaming\npm\node_modules\appium\node_modul
es\sqlite3
gyp ERR! node -v v7.8.0
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.e
xe C:\Users\tecdvp3\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js co
nfigure --fallback-to-build --module=C:\Users\tecdvp3\AppData\Roaming\npm\node_m
odules\appium\node_modules\sqlite3\lib\binding\node-v51-win32-x64\node_sqlite3.n
ode --module_name=node_sqlite3 --module_path=C:\Users\tecdvp3\AppData\Roaming\np
m\node_modules\appium\node_modules\sqlite3\lib\binding\node-v51-win32-x64 --pyth
on=C:\Users\tecdvp3.windows-build-tools\python27\python.exe --msvs_version=2015
’ (1)
node-pre-gyp ERR! stack at ChildProcess. (C:\Users\tecdvp3\AppDat
a\Roaming\npm\node_modules\appium\node_modules\sqlite3\node_modules\node-pre-gyp
\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:194:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:899:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/chi
ld_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 6.1.7601
node-pre-gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\tecd
vp3\AppData\Roaming\npm\node_modules\appium\node_modules\sqlite3\node_mo
dules\node-pre-gyp\bin\node-pre-gyp” “install” “–fallback-to-build”
node-pre-gyp ERR! cwd C:\Users\tecdvp3\AppData\Roaming\npm\node_modules\appium\n
ode_modules\sqlite3
node-pre-gyp ERR! node -v v7.8.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.31
node-pre-gyp ERR! not ok
Failed to execute ‘C:\Program Files\nodejs\node.exe C:\Users\tecdvp3\AppData\Roa
ming\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --m
odule=C:\Users\tecdvp3\AppData\Roaming\npm\node_modules\appium\node_modules\sqli
te3\lib\binding\node-v51-win32-x64\node_sqlite3.node --module_name=node_sqlite3
–module_path=C:\Users\tecdvp3\AppData\Roaming\npm\node_modules\appium\node_modu
les\sqlite3\lib\binding\node-v51-win32-x64 --python=C:\Users\tecdvp3.windows-bu
ild-tools\python27\python.exe --msvs_version=2015’ (1)
npm WARN Error: EPERM: operation not permitted, lstat ‘C:\Users\tecdvp3\AppData
Roaming\npm\node_modules\appium\node_modules\sqlite3\node_modules\node-pre-gyp\n
ode_modules\rimraf\node_modules\glob\node_modules\once\node_modules’
npm WARN { Error: EPERM: operation not permitted, lstat ‘C:\Users\tecdvp3\AppDa
ta\Roaming\npm\node_modules\appium\node_modules\sqlite3\node_modules\node-pre-gy
p\node_modules\rimraf\node_modules\glob\node_modules\once\node_modules’
npm WARN errno: -4048,
npm WARN code: ‘EPERM’,
npm WARN syscall: ‘lstat’,
npm WARN path: ‘C:\Users\tecdvp3\AppData\Roaming\npm\node_modules\appiu
m\node_modules\sqlite3\node_modules\node-pre-gyp\node_modules\rimraf\node
_modules\glob\node_modules\once\node_modules’ }
npm ERR! Windows_NT 6.1.7601
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js” “install” “-g” “appium”
npm ERR! node v7.8.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script ‘node-pre-gyp install --fall
back-to-build’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs sqlite3
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls sqlite3
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\tecdvp3\AppData\Roaming\npm-cache_logs\2017-04-07T09_46_4
6_532Z-debug.log

Please find solution for above problem:

npm config set strict-ssl=false // set firewall to false

// install windows build tools for python configuration
npm install --global --production windows-build-tools
npm install --global node-gyp

npm config set strict-ssl=true // set firewall to true again

npm cache clean // Clean cache of node

Appium server 1.6.4
Java 1.8
Selenium 3.3.1
Appium Java Client 5.0.0.0-Beta6

Upgrading from Appium 1.6.3 did the trick to work with Android N in Windows 10 where I had similar problems

@Bensam_Viswambharan
Thanks…we are able to work with Android N in Windows 10 using the above mentioned configs.

@harigovind what approach you used to fix this? i am getting error when connected device with android 7 and appium version i am using is 1.4.16.1 doing this on windows.

Please guide

@madiharehman Why don’t you try update your appium , Latest is 1.6.x , and if u r using java, client version is 5.x . They have fix for this issue

@harigovind http://discuss.appium.io/u/harigovind I have updated appium
to 1.6 but my java version is 8 as i am running jmeter too on same machine
and it required java version 8.

I can start the appium server via node.js setting the required port and ip
but here how will i give the SDK path as error i get is that SDK path is
not correct. As 1.6 Appium is non GUI version i am unable to find the
solution on how to exactly use this version of appium.