user11756290
user11756290

Reputation: 41

Unable to create a new remote session. (appium error)

I'm about running my appium automation on aws device farm, and when I'm doing

mvn clearn package
and the test starts, I'm getting an error. The error:

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 instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.

I did about 2 hours of searching in google - nothing help. I'm checked if the JAVA_HOME and ANDROID_HOME vars registerd, and they are.

Java code:

@BeforeMethod
    public void setUp() throws MalformedURLException {
        dc.setCapability("reportDirectory", reportDirectory);
        dc.setCapability("reportFormat", reportFormat);
        dc.setCapability("testName", testName);
        dc.setCapability("platformVersion", "8.0");
        dc.setCapability("platform", "Android");
        dc.setCapability(MobileCapabilityType.DEVICE_NAME, "ce0318237d211b0f01");
        dc.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, "com.sec.android.app.sbrowser");
        dc.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, ".SBrowserMainActivity");
        driver = new AndroidDriver<AndroidElement>(new URL("http://0.0.0.0:4723/wd/hub"), dc);
    }

Pom.xml: https://pastebin.com/s88ViRTA
Appium server log: https://pastebin.com/CU1MhdSr Thank you for who will try to help, Alon.

Upvotes: 2

Views: 11461

Answers (3)

Lubna mariyam
Lubna mariyam

Reputation: 402

Try installing the latest appium version

because your error shows "Original error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output."

Upvotes: 1

Jaskaran
Jaskaran

Reputation: 380

Please set the following capability : "automationName": "UiAutomator1"

You should be good.

Upvotes: 1

Haris Saleem
Haris Saleem

Reputation: 49

Try reinstalling uiautomator2.server:

adb uninstall io.appium.uiautomator2.server
adb uninstall io.appium.uiautomator2.server.test

This is the exception in your attached log:

ComponentInfo{io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner} from pid=17958, uid=17958 not allowed because package io.appium.uiautomator2.server.test does not have a signature matching the target io.appium.uiautomator2.server

source: https://github.com/appium/appium/issues/10993

Upvotes: 1

Related Questions