Sanniv Khare 6 min read

Embedded photo picker beta01 in Compose: what really builds

Embedded photo picker beta01 in Compose: what really builds

AndroidX released the embedded photo picker 1.0.0-beta01 on 2 Dec 2026 and dropped the opt-in annotation, so EmbeddedPhotoPicker, EmbeddedPhotoPickerState and rememberEmbeddedPhotoPickerState are now stable API. Three things will trip you up when you add it:

  1. The dependency lines on the release notes page (androidx.photopicker:photopicker-compose:1.0.0-beta01) do not resolve. The artifact is androidx.photopicker:photopicker-embedded-compose:1.0.0-beta01, package androidx.photopicker.embedded.compose.
  2. The sample in the embedded picker guide passes the callbacks to EmbeddedPhotoPicker. In beta01 they belong to rememberEmbeddedPhotoPickerState, and the guide’s call fails with three compile errors.
  3. The picker needs Android 14 (API 34) with SDK extension 15. Lint catches a missing API 34 check; you still have to check the extension yourself.

We built all of this with Gradle 9.6.0, AGP 9.4.0, Kotlin 2.3.21, Compose Foundation 1.10.0 and compileSdk 37.2 on our M1 lab Mac. This post covers the dependency, the code and the build; how the picker looks and behaves on a phone is outside it.

Why we did this: adding product photos is the slowest screen in Shopkeeper, and an inline picker that needs no storage permission is the obvious candidate to replace the system sheet there.

The artifact names, checked against Google Maven

Release 1.0.0-alpha03 (21 Oct 2026) renamed the artifacts: photopicker became photopicker-embedded, photopicker-compose became photopicker-embedded-compose, and the testing artifact followed. The beta01 snippet on the same page still shows the old names. We asked Gradle to fetch every candidate at 1.0.0-beta01:

Gradle resolving photopicker-compose (not found) and photopicker-embedded-compose (found), then the guide sample failing to compile

Real output from our lab build: the old name is not on Google Maven, and the guide’s call shape no longer compiles.

Coordinate at 1.0.0-beta01 On Google Maven What is inside
androidx.photopicker:photopicker-compose no
androidx.photopicker:photopicker no
androidx.photopicker:photopicker-embedded-compose yes, 42,646-byte AAR EmbeddedPhotoPicker, EmbeddedPhotoPickerState, rememberEmbeddedPhotoPickerState
androidx.photopicker:photopicker-embedded yes, 17,147-byte AAR EmbeddedPhotoPickerView for View-based screens
androidx.photopicker:photopicker-activity yes, 61,932-byte AAR PickVisualMedia, PickMultipleVisualMedia contracts and request params

So the Gradle line is:

// libs.versions.toml: photopicker = "1.0.0-beta01"
implementation("androidx.photopicker:photopicker-embedded-compose:1.0.0-beta01")

In our release runtime classpath that line added only the one artifact; its POM brings Compose UI and runtime 1.8.1 (resolved up to our 1.10.0), coroutines 1.9.0 and annotation 1.9.1. The sibling artifacts are listed only as version constraints, so photopicker-activity is not pulled in for you.

The release notes also say Compose libraries now need compileSdk 37.1 and AGP 9.2.0 or later. Our build used compileSdk 37 with minor level 2:

android {
    compileSdk { version = release(37) { minorApiLevel = 2 } }
    defaultConfig { minSdk = 26; targetSdk = 36 }
}

Where the callbacks went

The guide was written for alpha01, when EmbeddedPhotoPicker took onUriPermissionGranted, onUriPermissionRevoked and onSelectionComplete. Alpha03 refactored the state, and in beta01 those callbacks, plus a new onError, are parameters of rememberEmbeddedPhotoPickerState. EmbeddedPhotoPicker itself now takes only state, modifier, an optional provider and embeddedPhotoPickerFeatureInfo.

Side by side: the guide's call shape with callbacks on EmbeddedPhotoPicker, and the beta01 shape with callbacks on rememberEmbeddedPhotoPickerState

Left: the guide’s sample with the beta01 package, three “No parameter with name” errors. Right: the shape that builds.

Two more details from the beta01 sources:

  • EmbeddedPhotoPicker is an AndroidView around a SurfaceView with setZOrderOnTop(true). The picker draws above your window, so do not plan to put your own UI on top of it.
  • The state is saved with rememberSaveable: the selected URIs and the expanded flag survive a configuration change. selectedMedia is a read-only set you can show next to the picker.

The screen we built

This is the screen from our lab build (Compose imports left out, logging added). It shows the embedded picker when the device supports it and falls back to the system picker otherwise.

import android.net.Uri
import android.util.Log
import android.os.Build
import android.os.ext.SdkExtensions
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.PickVisualMediaRequest
import androidx.activity.result.contract.ActivityResultContracts.PickMultipleVisualMedia
import androidx.activity.result.contract.ActivityResultContracts.PickVisualMedia
import androidx.annotation.RequiresApi
import androidx.annotation.RequiresExtension
import androidx.photopicker.embedded.compose.EmbeddedPhotoPicker
import androidx.photopicker.embedded.compose.rememberEmbeddedPhotoPickerState

fun embeddedPickerAvailable(): Boolean =
    Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE &&
        SdkExtensions.getExtensionVersion(Build.VERSION_CODES.UPSIDE_DOWN_CAKE) >= 15

@Composable
fun ProductPhotos() {
    val photos = remember { mutableStateListOf<Uri>() }
    Column(Modifier.padding(16.dp)) {
        BasicText("Product photos: ${photos.size}")
        if (embeddedPickerAvailable()) InlinePicker(photos) else SystemPickerButton(photos)
    }
}

@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
@RequiresExtension(extension = Build.VERSION_CODES.UPSIDE_DOWN_CAKE, version = 15)
@Composable
fun InlinePicker(photos: MutableList<Uri>) {
    val state = rememberEmbeddedPhotoPickerState(
        onUriPermissionGranted = { uris -> photos += uris },
        onUriPermissionRevoked = { uris -> photos -= uris.toSet() },
        onSelectionComplete = { /* collapse your sheet */ },
        onError = { e -> Log.w("Photos", "embedded picker", e) },
    )
    EmbeddedPhotoPicker(state = state, modifier = Modifier.height(420.dp))
}

@Composable
fun SystemPickerButton(photos: MutableList<Uri>) {
    val launcher = rememberLauncherForActivityResult(PickMultipleVisualMedia(5)) { uris ->
        photos += uris
    }
    BasicText(
        "Add photos",
        Modifier.clickable { launcher.launch(PickVisualMediaRequest(PickVisualMedia.ImageOnly)) },
    )
}

The fallback uses the PickMultipleVisualMedia contract from androidx.activity, which every Compose app already has. There is no storage permission in the manifest for either path: the picker grants access to the URIs the user picks.

Why the extension check is your job

Both EmbeddedPhotoPicker and rememberEmbeddedPhotoPickerState carry @RequiresApi(34) and @RequiresExtension(extension = 34, version = 15). The guide states the same floor: “Android 14 (API level 34) with SDK Extensions version 15 or higher”. The library’s minSdk is 23, so nothing stops you from calling it on an older device except your own check.

We built a second copy of the screen that calls InlinePicker with no check at all and ran lint on both:

Module Lint (lintDebug)
Guarded screen above 0 errors, 3 warnings (old targetSdk, no resource shrinking, no app icon: all from the sample project)
Same screen, no check 2 errors: Call requires API level 34 (current min is 26) on rememberEmbeddedPhotoPickerState and on EmbeddedPhotoPicker (NewApi)

Lint reported the API level and said nothing about the extension version, so do not rely on it for that half. An Android 14 device below extension 15 passes an SDK_INT >= 34 check; keep the SdkExtensions.getExtensionVersion part of the condition.

What it costs in APK size

Same sample app, release build with R8 (isMinifyEnabled = true), unsigned:

Build Release APK
Compose screen without the picker 807,847 bytes
With photopicker-embedded-compose and the fallback 857,323 bytes

That is 49,476 bytes more for the picker library, the two screens and the fallback, in this one sample on our lab Mac. Your number depends on what your app already ships.

Porting from an alpha

  • Change photopicker-compose to photopicker-embedded-compose (and photopicker to photopicker-embedded for Views) in your version catalog.
  • Change imports from androidx.photopicker.compose to androidx.photopicker.embedded.compose.
  • Remove @OptIn(ExperimentalPhotoPickerComposeApi::class): the annotation is gone in beta01.
  • Move the three callbacks from EmbeddedPhotoPicker(...) into rememberEmbeddedPhotoPickerState(...) and add onError.
  • If you passed inputs to rememberEmbeddedPhotoPickerState, wrap the call in key(...) instead, as the alpha03 notes say.
  • If you used PickVisualMedia from androidx.photopicker, those contracts now live in photopicker-activity.

Earlier Android posts from the same lab setup: SharedPreferences to DataStore 1.3 and Gradle version catalogs.

Made by the team behind this post

Apps from our studio

  • Goes with this post

    BMDB.fun

    Your Bollywood world at a glance, with links straight to the OTT app that streams each film.

    Android TV · Web · Mobile

    Get
  • Nix

    The Mac uninstaller that finds what the Trash leaves behind: caches, logs, derived data and saved states.

    macOS

    Get
  • Cardigami

    Pop-up greeting cards that rise out of the fold on iPhone Duo.

    iPhone · App Store

    Get
  • OneClick QuitAll

    Quit every running app in one click. See memory and CPU first.

    macOS · Mac App Store

    Get

Need this built? Let’s talk.

We build and run apps for Mac, TV, mobile and the web, and write about what we learn.