How to remove specific permission when build Android app with gradle?

前端 未结 1 1785
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-30 02:31

Recently Google auto merge permission from Google Service to final release apk. Some one ask here Why are permissions being automatically added to my AndroidManifest when in

相关标签:
1条回答
  • 2020-11-30 02:59

    Add attribute tools:node with a value of remove to your manifest:

    <manifest ... xmlns:tools="http://schemas.android.com/tools">
        ...
        <uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove"/>
        ...
    </manifest>
    

    See http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger#TOC-tools:node-markers

    Don't forget to add the tools namespace to the root element of your manifest.

    0 讨论(0)
提交回复
热议问题