Issue
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?
Solution
@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).
Answered By - Karamazov
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.