My team uses the Instabug APK on Android (and iOS) and we'd like to disable user location tracking since we don't need it. I can't find anywhere how to do so.
How does Instabug even track the user's location to begin with? Our app doesn't have any location permissions.
Libraries add automatically the permissions they need. Final manifest file is a merge of your app's manifest file and all libraries'.
You can check the merged manifest by using Android Studio > AndroidManifest.xml > Merged Manifest tab
or
ANDROID_SDK_PATH/build-tools/28.0.3/aapt d permissions yourApp.apk
You can remove the location permission by adding tools:node="remove".
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" tools:node="remove" />
https://developer.android.com/studio/build/manage-manifests
Related
I am using the reactiveBLE library (which is by the way excellent, thank you for that).
However, with the newer version, it brings its own manifest file, so I don´t have to add any permissions to mine. The manifest file of reactiveBLE and one of my app are supposed to be merged together when building the app.
Because different rules are needed for different APIs, reactiveBLE adjusts its permissions accordingly. It seems that for Bluetooth, android.permission.ACCESS_FINE_LOCATION and android.permission.ACCESS_COARSE_LOCATION are only needed for APIs 23 - 30.
The code is then (for example):
uses-permission-sdk-23
android:name="android.permission.ACCESS_FINE_LOCATION"
android:maxSdkVersion="30"
However, as I also include other location services (which do need these permissions for other APIs as well), I would have to remove the "android:maxSdkVersion="30" part. This is also recommended in the official documentation:
official documentation on how to remove maxSdkVersion
However, this is not possible, because the manifest file of reactiveBle is generated automatically each time I build something (and my changes are overwritten again).
The app is working fine, but I am getting errors in the Play Console when uploading the app to the Playstore.
Please advise how I can merge the manifest files properly, so I do not get an error when uploading to the Play Console.
Kind regards
René
This solution from reactiveBLE issues worked for me.
To prevent conflicts with you own permissions, in your AndroidManifest.xml file include:
<uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION" tools:node="remove"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission-sdk-23 android:name="android.permission.ACCESS_COARSE_LOCATION" tools:node="remove"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
You will also need to add xmlns:tools="http://schemas.android.com/tools" in the manifest tag at the top of the file.
I removed the WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE permissions from the project's AndroidMainfest.xml and AssemblyInfo.cs files.
I uploaded the .apk to Play Store and in the Bundle permissions the Write & Read permissions were showing up.
Then I analyzed the .apk using Analyze APK feature in Android Studio, and in that, AndroidMainfest.xml has WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE.
Though, I ask for CrossPermissions.Current.CheckPermissionStatusAsync(Permission.Storage) on run time, but when I removed it and Analyzed the APK, still it includes WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE permissions in Manifest file.
I then add the android:requiredFeature="false" flag to Write & Read permissions like this:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:requiredFeature="false" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:requiredFeature="false" />
And when I Analyzed the APK again, Write & Read permissions are there with android:requiredFeature="false". But on Play Store, in the Bundle permissions they are there as before.
I don't know why these permissions are ending up there?
#Sergey Comment: They can be merged from the dependent library. You can check if any library you are using have those permissions in their Manifest file.
I looked into it and found this article How Libraries can silently add permissions to your Android App and the Fix. It Worked.
But I'm using camera, and I was storing these pictures in the Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData). Which requires WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE permissions.
So, I replace the path with FileSystem.CacheDirectory and it worked (Intenral Storage doesn't requires Read and Write Permissions in Manifest file).
Good day.
In my cordova app I don't use ACCESS_BACKGROUND_LOCATION, and there is no any uses-permission strings about ACCESS_BACKGROUND_LOCATION in config.xml neither in AndroidManifest.xml, but when I try to upload APK into Google Play, it's failed and Google says that I use at least one feature that uses access to the location in background. I want to delete ACCESS_BACKGROUND_LOCATION clearly.
What I need to do?
I added
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" tools:node="remove" />
to AndroidManifest.xml. Is that enough?
Our app needs to display maps independent of the user's location, but the Play Console reports that the app is requesting the ACCESS_FINE_LOCATION permission (which is not in the app's manifest). The only Mapbox dependency lines used are:
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.3.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.8.0'
Looking at the manifest merge output shows that the permission is being requested by the manifest added by the main Mapbox SDK dependency. In it is this line:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Is there a way to use the Mapbox SDK without having the app request the unneeded permission?
The solution, as reported by the Mapbox support team, is to just remove the undesired permission from the app's manifest file:
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"
tools:node="remove" />
My app has added this permission , but in some device has this error message, all in android 4.4(4.4.2)
java.lang.SecurityException Neither user 10145 nor current process has
android.permission.WAKE_LOCK.
If You Are Using Acra Library Check This Answer :
https://stackoverflow.com/a/50972790/7377631
Your app is probably using a new version of ACRA library. In new the version they added to the lib AndroidManifest.xml file. The android:maxSdkVersion="25" is silently merged to main app AndroidManifest.xml file, hence the app doesn't have WAKE_LOCK permission on Oreo devices. The solution is add tools:node="replace" to your uses-permission declaration.
For example <uses-permission android:name="android.permission.WAKE_LOCK" tools:node="replace"/>.
Android permissions are case sensitive. So check whether you have added the permission correctly.
<uses-permission android:name="android.permission.WAKE_LOCK"/>
Also there is a known bug in Marshmallow. So try building by changing your targetsdk version is it is Android 6.0.