I have written the appium script while running the script on the real android device. I am facing the 500 error
`import io.appium.java_client.android.AndroidDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import java.net.URL;
public class hyerTest1 {
static AndroidDriver driver;
public static void main(String[] args) throws Exception {
// Set desired capabilities for the Android device and the app to be tested
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("platformName", "Android");
cap.setCapability("automationName", "UiAutomator2");
cap.setCapability("udid", "R5CRA1VFJAE"); // Device ID of the Android device
cap.setCapability("deviceName", "galaxy S21 5G"); // Name of the Android device
cap.setCapability("appPackage", "io.appium.android.apis"); // Package name of the app
cap.setCapability("appActivity", "io.appium.android.apis.ApiDemos"); // Activity name of the app
cap.setCapability("noReset","True");
// Specify the URL of the Appium server
URL url = new URL("https://127.0.0.1:4723/wd/hub/");
// Initialize the AndroidDriver with the specified capabilities and URL
driver = new AndroidDriver(url, cap);
// Print message to indicate that the application has started
System.out.println("Application started!!!");
}
}
`
I have found the error: Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: zipAlignApk failed. Original error: Command ”C:UsersSafiqur RahmanAppDataLocalAndroidSdkbuild-tools35.0.0-rc3zipalign.exe’ -f 4 ‘C:UsersSafiqur RahmanAppDataLocalProgramsAppiumresourcesappnode_modulesappiumnode_modulesappium-uiautomator2-serverapksappium-uiautomator2-server-v1.18.0.apk’ C:UsersSAFIQU~1AppDataLocalTemp2024328-9312-mpnq88.qs6mappium.tmp’ exited with code 1. Stdout: ”; Stderr: ‘Unable to open ‘C:UsersSafiqur RahmanAppDataLocalProgramsAppiumresourcesappnode_modulesappiumnode_modulesappium-uiautomator2-serverapksappium-uiautomator2-server-v1.18.0.apk’ as zip archive: No error
‘