When I build my application using Sendbird UIKit,
- application fails to attach files from ChannelFragment, and…
-
READ_EXTERNAL_STORAGE
permission 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_STORAGE
withandroid: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
targetSdkVersion
is under 33,READ_EXTERNAL_STORAGE
is just revoked.- There might be no problem if the application’s
targetSdkVersion
is 33, because other permissions such asREAD_MEDIA_IMAGES
is used instead ofREAD_EXTERNAL_STORAGE
(see Behavior changes: Apps targeting Android 13 or higher | Android Developers). 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.