question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Photo picker does not open with compile sdk 33 (Android 13)

See original GitHub issue

Describe the bug App picker does not open with compile sdk 33 after permission handling Tested with version 32 (Android 12) and it works

Sample code:

` val launcher = rememberLauncherForActivityResult(ActivityResultContracts.StartActivityForResult()) { if (it.resultCode == Activity.RESULT_OK) { onAvatarChanged(it.data?.data!!) } }

    AvatarImageUI(
        initials = firstName?.take(2) ?: "",
        avatarUri = avatarUrl,
        fontSize = 50.sp,
        canEdit = canEditAvatar,
        onEditClick = {
            ImagePicker.with(activity)
                .maxResultSize(maxAvatarSize, maxAvatarSize)
                .cropSquare()
                .provider(ImageProvider.BOTH)
                .setOutputFormat(
                    if (Utils.isAtleastR()) Bitmap.CompressFormat.WEBP_LOSSY else Bitmap.CompressFormat.WEBP
                )
                .createIntentFromDialog { launcher.launch(it) }
        },
        size = Constants.Size.AVATAR_BIG,
    )`

Looking forward to you comments. Thank you in advance

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
astuetzcommented, Sep 28, 2022

Hey, I can confirm that 2.3.20 works fine now! I guess my PR is no longer needed then?

1reaction
astuetzcommented, Sep 20, 2022

Tried it on the sample app and it works fine, UNTIL I switch the dependency from the local module to the latest maven artifact:

// implementation project(':imagepicker')
implementation "com.github.Drjacky:ImagePicker:2.3.19"

By doing so, the sample app again tells me that the storage permission is required.

If I look at the downloaded apk sources (or try to look at GalleryProvider inside AS), I can see the latest changes including READ_MEDIA_IMAGES. But as soon as I decompile the actual aar, all the latest changes are missing.

Looking at the report on jitpack, it also says ERROR: No build artifacts found at the very end, so maybe something’s wrong with publishing?

Just to be safe I also tried clearing all my caches, but the problem still persists.

Read more comments on GitHub >

github_iconTop Results From Across the Web

New Photo Picker on Android 13/API Level 33 - YouTube
... try restarting your device. Your browser can't play this video. ... New Photo Picker on Android 13 / API Level 33 -...
Read more >
Photo picker | Android Developers
The photo picker provides a browsable, searchable interface that presents the user with their media library, sorted by date from newest to oldest....
Read more >
Android 13 Photo Picker With The Activity Result API - Medium
1. Setup. The Photo Picker requires your app to target at least version 33 of the Android SDK. To comply with this requirement,...
Read more >
How Google is backporting Android 13's Photo Picker
Google made the Photo Picker APIs public a couple of months ago, but in order to use them, an app needs to be...
Read more >
What library is needed for Photo Picker of Android 13?
API 32 is Android 12L, not Android 13. You need to follow the Set up the Android 13 SDK instructions to use Android...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found