appium/appium

settings_apk-debug.apk: No such file or directory

VladGoogle opened this issue · 17 comments

The problem

I am a newbie in the Appium, and I get such error while trying to start a session through the Appium Inspector:
Failed to create a session.
An unknown server-side error occurred while processing the command.

Original error: Error executing adbExec.
 Original error: 'Command 'C:\\Users\\xukin\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 install -g C:\\Windows\\system32\\node_modules\\appium-uiautomator2-driver\\node_modules\\io.appium.settings\\apks\\settings_apk-debug.apk' exited with code 1'; 
Command output: 
adb: failed to stat C:\Windows\system32\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk: No such file or directory

Capabilities:

{
  "platformName": "Android",
  "appium:platformVersion": "12",
  "appium:deviceName": "Pixel XL",
  "appium:app": "C:/Users/xukin/OneDrive/Документы/app-release.apk",
  "appium:automationName": "UIAutomator2",
  "appium:udid": "emulator-5554"
}

I looked at this path, and the file was there(file). Does someone know what the problem is?

Environment

  • Appium version: 2.0.0-beta.44
  • OS: Windows 11 Pro
  • Node.js: 16.13.1
  • Emulator:
    Device name: Pixel XL;
    Platform name: Android;
    Platform version: 12;
    Automation name: UIAutomator2;
    API version: 31

Hi, I had the same problem. I solved this the following, I installed this apk (settings_apk-debug.apk) manually. Also, after this will be a problem with another apk and you should also install it manually.

You should copy apk what you need to the directory with short path, for example:
C:\Users\{yourAcaunt}\Downloads\settings_apk-debug.apk
And than you need to enter in cmd the next:
C:\\Users\\xukin\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 install -g C:\Users\{yourAccouunt}\Downloads\settings_apk-debug.apk

I think this problem connects to the long path to apk or adb.

Hi, I had the same problem. I solved this the following, I installed this apk (settings_apk-debug.apk) manually. Also, after this will be a problem with another apk and you should also install it manually.

You should copy apk what you need to the directory with short path, for example: C:\Users\{yourAcaunt}\Downloads\settings_apk-debug.apk And than you need to enter in cmd the next: C:\\Users\\xukin\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 install -g C:\Users\{yourAccouunt}\Downloads\settings_apk-debug.apk

I think this problem connects to the long path to apk or adb.

Thanks, the previous error disappeared, but right now I start to get a new one. I reinstall it manually, as settings_apk-debug.apk file, but it doesn't work. Here are images: first_file, second_file.
Failed to create session. An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'C:\\Users\\xukin\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 install -r --no-incremental C:\\Windows\\system32\\node_modules\\appium-uiautomator2-driver\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-v5.7.0.apk' exited with code 1'; Command output: adb: failed to stat C:\Windows\system32\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v5.7.0.apk: No such file or directory

Hi, I had the same problem. I solved this the following, I installed this apk (settings_apk-debug.apk) manually. Also, after this will be a problem with another apk and you should also install it manually.
You should copy apk what you need to the directory with short path, for example: C:\Users\{yourAcaunt}\Downloads\settings_apk-debug.apk And than you need to enter in cmd the next: C:\\Users\\xukin\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 install -g C:\Users\{yourAccouunt}\Downloads\settings_apk-debug.apk
I think this problem connects to the long path to apk or adb.

Thanks, the previous error disappeared, but right now I start to get a new one. I reinstall it manually, as settings_apk-debug.apk file, but it doesn't work. Here are images: first_file, second_file. Failed to create session. An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'C:\\Users\\xukin\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 install -r --no-incremental C:\\Windows\\system32\\node_modules\\appium-uiautomator2-driver\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-v5.7.0.apk' exited with code 1'; Command output: adb: failed to stat C:\Windows\system32\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v5.7.0.apk: No such file or directory

I had the same problem after installing settings_apk-debug.apk manually, but after I installed this I didn't have the same problem as you. Maybe you need to update all and reinstall.

Also, I see that you run another script that you have in the log (install -r --no-incremental). Try will run like this code
{youPath}\\adb.exe -P 5037 -s emulator-5554 install -r --no-incremental C:\\{youPath}\\appium-uiautomator2-server-v5.7.0.apk

Closed as not a server issue

Sorry I am kind of new here, but:
When you say "I installed whatever-apk manually. Where do you install it from?? Where do I look for it?

Sorry I am kind of new here, but: When you say "I installed whatever-apk manually. Where do you install it from?? Where do I look for it?

This file is located in C:\Windows\system32\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\

Your error log should have recorded this path

Hi, I had the same problem. I solved this the following, I installed this apk (settings_apk-debug.apk) manually. Also, after this will be a problem with another apk and you should also install it manually.
You should copy apk what you need to the directory with short path, for example: C:\Users\{yourAcaunt}\Downloads\settings_apk-debug.apk And than you need to enter in cmd the next: C:\\Users\\xukin\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 install -g C:\Users\{yourAccouunt}\Downloads\settings_apk-debug.apk
I think this problem connects to the long path to apk or adb.

Thanks, the previous error disappeared, but right now I start to get a new one. I reinstall it manually, as settings_apk-debug.apk file, but it doesn't work. Here are images: first_file, second_file. Failed to create session. An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'C:\\Users\\xukin\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 install -r --no-incremental C:\\Windows\\system32\\node_modules\\appium-uiautomator2-driver\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-v5.7.0.apk' exited with code 1'; Command output: adb: failed to stat C:\Windows\system32\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v5.7.0.apk: No such file or directory

I had the same problem after installing settings_apk-debug.apk manually, but after I installed this I didn't have the same problem as you. Maybe you need to update all and reinstall.

Also, I see that you run another script that you have in the log (install -r --no-incremental). Try will run like this code {youPath}\\adb.exe -P 5037 -s emulator-5554 install -r --no-incremental C:\\{youPath}\\appium-uiautomator2-server-v5.7.0.apk

I fixed the first error of settings_apk-debug.apk
Now I am getting this second error exactly like him appium-uiautomator2-server-v5.7.0.apk
I am trying to put in cmd what you told in the comment but not working.
Could you detail the steps you talk about please just to make sure I am doing it good.

Hi, I had the same problem. I solved this the following, I installed this apk (settings_apk-debug.apk) manually. Also, after this will be a problem with another apk and you should also install it manually.
You should copy apk what you need to the directory with short path, for example: C:\Users\{yourAcaunt}\Downloads\settings_apk-debug.apk And than you need to enter in cmd the next: C:\\Users\\xukin\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 install -g C:\Users\{yourAccouunt}\Downloads\settings_apk-debug.apk
I think this problem connects to the long path to apk or adb.

Thanks, the previous error disappeared, but right now I start to get a new one. I reinstall it manually, as settings_apk-debug.apk file, but it doesn't work. Here are images: first_file, second_file. Failed to create session. An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'C:\\Users\\xukin\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 install -r --no-incremental C:\\Windows\\system32\\node_modules\\appium-uiautomator2-driver\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-v5.7.0.apk' exited with code 1'; Command output: adb: failed to stat C:\Windows\system32\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v5.7.0.apk: No such file or directory

I had the same problem after installing settings_apk-debug.apk manually, but after I installed this I didn't have the same problem as you. Maybe you need to update all and reinstall.
Also, I see that you run another script that you have in the log (install -r --no-incremental). Try will run like this code {youPath}\\adb.exe -P 5037 -s emulator-5554 install -r --no-incremental C:\\{youPath}\\appium-uiautomator2-server-v5.7.0.apk

I fixed the first error of settings_apk-debug.apk Now I am getting this second error exactly like him appium-uiautomator2-server-v5.7.0.apk I am trying to put in cmd what you told in the comment but not working. Could you detail the steps you talk about please just to make sure I am doing it good.

You should find this file (C:\Windows\system32\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\) and put it in another folder with a short path. This helped me. It is the same solution that was in the first step. I really want to help but I didn't do anything else ) I just took the file put it in the folder with a short path and run a command that was in the error log on cmd ADB.

After ~2h trying various solution with current version (2023-07-21) i was unable find why adb fail install. Updated to prerelease version and all works
npm install -g appium@next

https://github.com/appium/appium/releases/tag/appium%402.0.0

After ~2h trying various solution with current version (2023-07-21) i was unable find why adb fail install. Updated to prerelease version and all works npm install -g appium@next

https://github.com/appium/appium/releases/tag/appium%402.0.0

Hi Can you eloborate how you solved this issue. Can you please give commands to update if any. @valentasm1

@Sankeert123 If you install appium like this npm install -g appium this will install current version. Just uninstall all and install next version npm install -g appium@next

@Sankeert123 If you install appium like this npm install -g appium this will install current version. Just uninstall all and install next version npm install -g appium@next

Done but no luck. Bro can you, mention the appium server version, UiAutomator2 version. and appium inspector version. Plss. @valentasm1.

You could open new issue with more details and mention me there.

You could open new issue with more details and mention me there.

Opened bro. They closed by saying duplicate as yours. @valentasm1

C:\Users\xukin\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 install -g C:\Users{yourAccouunt}\Downloads\settings_apk-debug.apk

I have manually installed below files into emulator and its worked for me.

  1. C:\Users\xukin\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 install -g C:\Users{yourAccouunt}\Downloads\settings_apk-debug.apk

  2. C:\Windows\system32\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v5.7.0.apk

Overall i wasnt happy with appium. We runing appium in ubuntu 22 and it took crazy amount just to run on CI. Not sure if other UI test frameworks are so flaky.

Is there a way to configure Appium to execute de ADB command to install both appium-uiautomator2-server-v#.#.#.apk and settings_apk-debug.apk by a custom path? Manual installation will help when testing on just one device, but it wont work for parallel testing on multiple devices.