Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception occurred while executing 'start' #35

Open
youvegotnigel opened this issue Apr 9, 2024 · 0 comments
Open

Exception occurred while executing 'start' #35

youvegotnigel opened this issue Apr 9, 2024 · 0 comments

Comments

@youvegotnigel
Copy link

I belive this is due to the android:exported="true" not defined in the AndroidManifest.xml file.
Is it possible to add this ?

Steps to Reproduce the Problem

  1. download release apk Version 2.0.1
  2. Execute below test
    @Test
    public void demo_android_test() throws MalformedURLException {

        UiAutomator2Options options = new UiAutomator2Options();
        options.setDeviceName("nigel-test-device");
        options.setAppPackage("com.saucelabs.mydemoapp.android");
        options.setAppActivity("com.saucelabs.mydemoapp.android.view.activities.MainActivity");
        options.setCapability("app",
                System.getProperty("user.dir") + File.separator + "apps" + File.separator + "SauceLabs-Demo-App.apk");

        AndroidDriver driver = new AndroidDriver(new URL("http://127.0.0.1:4723"), options);

        findElement(driver, AppiumBy.accessibilityId("View menu")).click();

        driver.quit();
    }

Error

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: Cannot start the 'com.saucelabs.mydemoapp.android' application. Consider checking the driver's troubleshooting documentation. Original error: Error executing adbExec. Original error: 'Command '/Users/nigelmulholland/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am start -W -n com.saucelabs.mydemoapp.android/com.saucelabs.mydemoapp.android.view.activities.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' exited with code 255'; Command output:
Exception occurred while executing 'start':
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.saucelabs.mydemoapp.android/.view.activities.MainActivity } from null (pid=12812, uid=2000) not exported from uid 10167
at com.android.server.wm.ActivityTaskSupervisor.checkStartAnyActivityPermission(ActivityTaskSupervisor.java:1110)
at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1024)
at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:713)
at com.android.server.wm.ActivityTaskManagerService.startActivityAndWait(ActivityTaskManagerService.java:1562)
at com.android.server.am.ActivityManagerService.startActivityAndWait(ActivityManagerService.java:3148)
at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:598)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:208)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:9197)
at android.os.Binder.shellCommand(Binder.java:1049)
at android.os.Binder.onTransact(Binder.java:877)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:4731)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2630)
at android.os.Binder.execTransactInternal(Binder.java:1285)
at android.os.Binder.execTransact(Binder.java:1244)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant