An unknown server-side error occurred while processing the command. Original error: The application at 'E:\****\*****.apk' does not exist or is not accessible

Here I’m trying to install app using .apk file via appium automation script, so I’m specifying the capability respectively, but I’m facing this error continuously. When I checked the location of the .apk file it was present there and it was correct

                DesiredCapabilities caps = new DesiredCapabilities();
                caps.setCapability("deviceName", "OnePlusNordCE");
                caps.setCapability("udid", "6$%**"); //DeviceId from "adb devices" command
                caps.setCapability("platformName", "Android");
                caps.setCapability("platformVersion", "12");
                caps.setCapability("automationName", "UiAutomator2");
                caps.setCapability("adbExecTimeout", "20000");
                caps.setCapability("autoGrantPermissions", "true");
                caps.setCapability("app",
                        new File("E:\\****\\*******.apk").getAbsolutePath());
                WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4723/wd/hub"), caps);

Note: When I manually install the app and mention the apps package and activity the automation in that app works fine, but installing the app using “app” capability throws me this error.

Any help is much appreciated

usually the path is not correct as you said yourself. I am not sure what you tried/didn’t try but you can try 2 additional things:

  1. instead of passing appium the file immediately, hold it in a variable(let’s call it apkFile) and print the result of apkFile.isExist() and apkFile.getAbsolutePath() and see if it matches your expectation.
  2. instead of trying to see if the apk exists or not though the UI window. open your terminal app and just copy the exact path from the error message and run cd copiedPath and then just run ls command and see if the apk is indeed exist in this path.

Exception in thread "main" org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: The application at 'C:\Users\SG\Downloads\LinearScript\src\test\resources\p@@@.apk' does not exist or is not accessible[[[--udid 6f1523 --name OnePlusNordCE --sessionId 183db617-1895-47d0-b87]]]

When I checked the same location in the cmd I could see the .apk file there

When I did the first step the exists() method returned true

        File app = new File("src/test/resources/p@@@o.apk");
        System.out.println("app is present >>> " + app.exists());
        DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability("deviceName", "OnePlusNordCE");
        caps.setCapability("udid", "6f152707"); //DeviceId from "adb devices" command
        caps.setCapability("platformName", "Android");
        caps.setCapability("platformVersion", "12");
        caps.setCapability("automationName", "UiAutomator2");
        caps.setCapability("adbExecTimeout", "20000");
        caps.setCapability("autoGrantPermissions", "true");
        caps.setCapability("app", app.getAbsolutePath());

I could see the .apk file in the mentioned location, but the installation is not happening

maybe you already solved it.
try to check the permissions of the file, that it is accessible. try to alter its permissions using chmod command.