AndroidTest Manifest permission not detected

佐手、 提交于 2019-12-12 19:16:41

问题


I have androidTest Manifest that has this permission:

<uses-permission android:name="android.permission.SET_ANIMATION_SCALE" />

However, when I run the test, this permission is not set in my devDebug build. It only works when I add it to main/AndroidManifest.xml.

Full androidTest/AndroidManifest.xml,

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.test.mobile">

    <uses-sdk
        android:minSdkVersion="15"
        android:targetSdkVersion="23"
        tools:overrideLibrary="android.support.test.uiautomator.v18" />
    <uses-permission android:name="android.permission.SET_ANIMATION_SCALE" />
</manifest>

Error:

Operation not allowed: java.lang.SecurityException: Package com.test.mobile has not requested permission android.permission.SET_ANIMATION_SCALE

I don't want to add this permission in main Manifest.


回答1:


Create a debug folder and add AndroidManifest.xml in it with the permission.



来源:https://stackoverflow.com/questions/37283294/androidtest-manifest-permission-not-detected

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!