Android Automation Error Displayed: "Security exception: Permission Denial: starting Intent"

tsk :

Tested multiple android native applications using appium/selenium automation script but none of the applications are getting opened and getting the following error message

Stderr: 'Security exception: Permission Denial: starting Intent from null (pid=20930, uid=2000) not exported from uid 10178'

The Desired capabilities are set correctly but none of the apps are getting opened.

DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability("deviceName", "Mobile");
        caps.setCapability("udid", "520042c3b5e5"); 
        caps.setCapability("platformName", "Android");
        caps.setCapability("platformVersion", "8.0.0"); 
        caps.setCapability("appPackage", "in.amazon.mShop.android.shopping");
        caps.setCapability("appActivity", "com.amazon.mShop.home.web.MShopWebGatewayActivity");
        caps.setCapability("noReset", "true");          

        //Instantiate Appium Driver
        try 
        {
            AppiumDriver<MobileElement> driver = new AndroidDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"), caps);
        } 
        catch (MalformedURLException e) 
        {
            System.out.println(e.getMessage());
        }

Amazon mobile application should get opened but Security exception: Permission Denial error message is displayed.

Tried for other native apps by changing app package and activity and still getting the same error for all the apps tried.

There are few solutions online which says to edit an export field in AndroidManifest.xml. Where this File would be found?

Appium Version - 1.10.0 Java - JDK 1.8

Suban Dhyako :

You will get this kind of error when you try to launch the appActivity that is not main Activity.

You must put the main appActivity in your desired capability.

I also get the similar problem when the developer added the splash screen in the app and changed the main app activity.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=160508&siteId=1