When I build my application using Sendbird UIKit,
- application fails to attach files from ChannelFragment, and…
READ_EXTERNAL_STORAGEpermission is revoked (so the application cannot access external files at all).
Environment
- Sendbird UIKit 3.1.1
- Android 13
Application could access external files with UIKit 2.X, or on Android 12 or below.
Suspicious cause of this bug
- UIKit sets
READ_EXTERNAL_STORAGEwithandroid:maxSdkVersion="32"option (GitHub). - When UIKit’s AndroidManifest.xml is merged with the application’s one,
android:maxSdkVersion="32"is set - If the application’s
targetSdkVersionis under 33,READ_EXTERNAL_STORAGEis just revoked.- There might be no problem if the application’s
targetSdkVersionis 33, because other permissions such asREAD_MEDIA_IMAGESis used instead ofREAD_EXTERNAL_STORAGE(see https://developer.android.com/about/versions/13/behavior-changes-13#granular-media-permissions). But I didn’t confirmed that.
- There might be no problem if the application’s
Workaround
When I set tools:remove="android:maxSdkVersion" to the application’s AndroidManifest.xml, the application could access files as expected.