我的应用程序不需要读取手机状态,所以我想从我的 React native 应用程序中删除权限。
每次我从项目的任何地方删除它时,当我运行 ./gradlew assembleRelease
时它会再次重新添加
如何让它停止添加?
最佳答案
使用android list 合并
添加新文件android/app/src/release/AndroidManifest.xml
有内容
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
>
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove"/>
</manifest>
完成!有关 list 合并的更多信息:https://developer.android.com/studio/build/manifest-merge.html#merge_priorities , Merge priorities
部分关于android - React native - 不断添加 android.permission.READ_PHONE_STATE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43316101/