apk not found error on Mac Mojave.
Appium version 1.10.1
Java 8
Node v10.15.1
JavaClient 7.0.0
Server Error:
[debug] [W3C] Encountered internal error running command: Error: The application at ‘/Users/hashili/eclipse-workspace/DemoAppium/customer.apk’ does not exist or is not accessible
[debug] [W3C] at APPLICATIONS_CACHE_GUARD.acquire (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/helpers.js:136:13)
[HTTP] <-- POST /wd/hub/session 500 1525 ms - 729
Eclipse Error:
Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: The application at ‘/Users/hashili/eclipse-workspace/DemoAppium/customer.apk’ does not exist or is not accessible
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: '2018-11-14T08:17:03’
System info: host: ‘Soumya-KO.local’, ip: ‘fe80:0:0:0:4e:cc6d:a071:6834%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.14.2’, java.version: '1.8.0_91’
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: The application at ‘/Users/hashili/eclipse-workspace/DemoAppium/customer.apk’ does not exist or is not accessible
at getResponseForW3CError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:826:9)
at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:450:37)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: '2018-11-14T08:17:03’
System info: host: ‘Soumya-KO.local’, ip: ‘fe80:0:0:0:4e:cc6d:a071:6834%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.14.2’, java.version: '1.8.0_91’
Driver info: driver.version: AndroidDriver
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:208)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:84)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:94)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:95)
at Demo.DemoAppium.App.main(App.java:32)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:186)
… 13 more
Sample Java Code:
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;
public class App {
public static void main(String[] args) throws MalformedURLException {
DesiredCapabilities cap = new DesiredCapabilities();
AppiumDriver<MobileElement> driver = null;
cap.setCapability("automationName", "Appium");
cap.setCapability("platformName", "Android");
cap.setCapability("platformVersion", "6.0");
cap.setCapability("deviceName", "7f7852a8");
cap.setCapability("app", "/Users/hashili/eclipse-workspace/DemoAppium/customer.apk");
cap.setCapability("browserName", "");
cap.setCapability("appPackage", "com.customer");
cap.setCapability("appActivity", "com.customer.MainActivity");
cap.setCapability("noReset", false);
driver = new AndroidDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"), cap);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
}