如何删除“android.hardware.location"退出世博项目的许可请求? [英] How to remove "android.hardware.location" permission request from ejected Expo project?
问题描述
我有一个 React Native Expo 项目,它开始使用 Expo托管工作流".然而,从那以后,我退出了托管工作流程(同时仍在使用一些 expo 模块).
I have an React Native Expo project that started out using the Expo "managed workflow". However, since then I have ejected out of the managed workflow (while still using some expo modules).
我遇到的问题是 Expo 似乎向我的 Android 应用添加了任意权限请求.我必须从应用程序中删除此特定权限请求:android.hardware.location
.
The issue I'm experiencing is that Expo seems to have added arbitrary permission requests to my Android app.
I must remove this particular permission request from the app: android.hardware.location
.
我尝试了很多方法在我的 AndroidManifest.xml
文件中删除它,例如:
I've tried many ways to remove it in my AndroidManifest.xml
file, for example:
<uses-permission tools:node="remove" android:name="LOCATION_HARDWARE" />
<uses-permission tools:node="remove" android:name="ACCESS_COARSE_LOCATION" />
<uses-permission tools:node="remove" android:name="ACCESS_FINE_LOCATION" />
<uses-feature android:name="android.hardware.location" android:required="false" tools:node="remove" />
但最终捆绑的Android应用仍然请求android.hardware.location
权限.
But in the end the bundled Android app still requests the android.hardware.location
permission.
如何在捆绑应用之前将其删除?
How can I remove it before bundling the app?
推荐答案
通过从 package.json
中删除 expo
依赖项解决了这个问题.
This issue was resolved by removing the expo
dependency from package.json
.
expo
依赖项需要 expo-location
进而请求各种 android 位置权限.
The expo
dependency required expo-location
which in turn requested various android location permissions.
这篇关于如何删除“android.hardware.location"退出世博项目的许可请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!