Reputation: 31
I built an Android app using React Native and building the apk file using expo expo build:android
. However, when I run the app on an emulator, even after removing all permissions from AndroidManifest.xml, the app still asks for Physical Activity permissions:
android/app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="<package.name>">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<!-- OPTIONAL PERMISSIONS, REMOVE WHATEVER YOU DO NOT NEED -->
<!-- These require runtime permissions on M -->
<!-- END OPTIONAL PERMISSIONS -->
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="YOUR-APP-URL-HERE" />
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="YOUR-APP-SDK-VERSION-HERE" />
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
Permissions Screenshot
I have tried adding the tools:node="remove"
tag rather than removing the uses-permissions lines but this had no effect.
My app requires no permissions and this issue is preventing me from uploading to the Play Store. I read in other posts that a library I am using might be requesting permissions but I do not believe any of the npm libraries I am using would require any such permissions:
package.json
{
"main": "index.js",
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"web": "expo start --web",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"av": "^0.4.9",
"expo": "~37.0.3",
"expo-av": "^8.1.0",
"expo-updates": "~0.1.0",
"react": "~16.9.0",
"react-dom": "~16.9.0",
"react-native": "~0.61.5",
"react-native-elements": "^2.0.0",
"react-native-gesture-handler": "~1.6.0",
"react-native-modal": "^11.5.6",
"react-native-popup-dialog": "^0.18.3",
"react-native-reanimated": "~1.7.0",
"react-native-responsive-fontsize": "^0.4.3",
"react-native-responsive-screen": "^1.4.1",
"react-native-screens": "~2.2.0",
"react-native-unimodules": "~0.9.0",
"react-native-web": "~0.11.7"
},
"devDependencies": {
"@babel/core": "~7.9.0",
"babel-jest": "~25.2.6",
"jest": "~25.2.6",
"react-test-renderer": "~16.9.0"
},
"jest": {
"preset": "react-native"
},
"private": true
}
Any help would be appreciated.
Upvotes: 1
Views: 1545
Reputation: 31
So after some further digging, https://docs.expo.io/workflow/configuration/?redirected, what fixed this issue was adding android.permissions = []
to my app.json:
"android": {
"package": "<package name>",
"versionCode": 1,
"permissions": []}
Upvotes: 2