Product News

The first beta of Android 18

13 min read
View Matthew McCullough's profile
Matthew McCullough Vice President, Product Management, Android Developer

Today we're releasing the first Beta of Android 18, continuing our work to build a platform that prioritizes privacy, security, and refined performance. This build kicks off our biweekly Android 18 Beta release cycle, running in parallel with the conclusion of the Android 17 QPR3 Beta program. 

Android 18 extends the memory management foundation we built across Android 17, with Beta 1 introducing per-process soft memory limits for background services. Other Beta 1 highlights include:

  • New capabilities in Photo Picker including an inline camera tile
  • New system I/O APIs
  • A lock-free MessageQueue for all apps
  • Default time-based garbage collection and verification updates in the Android Runtime (ART)
  • Continued refinements for desktop windowing and adaptive form factors 

Continuous improvement and the Android 18 release cycle

Building on our transition to an always-on Android Canary channel, the Android 18 Beta program plans to release approximately every two weeks in a continuous improvement cycle:

  • Regular biweekly drops: New features, APIs, and stability fixes land in Beta through frequent over-the-air (OTA) updates as soon as they pass internal validation, rather than waiting for larger monthly milestones.
  • Parallel Beta cycles: Android 18 Beta 1 begins while the Android 17 QPR3 Beta cycle wraps up, giving you an early window to start testing against our next platform release without interrupting ongoing quarterly validation.
  • Streamlined CI and OTA testing: Once enrolled on a supported Pixel device, or configured with our 64-bit Android Emulator system images, you'll receive regular drops automatically as the platform matures.

Our annual major SDK release

Over the past year, Android has delivered new capabilities and minor SDK releases continuously across quarterly platform updates. Android 18 (API level 38) is our annual major SDK release, which includes planned app-breaking behavior changes. This allows us to continue evolving the platform across performance, memory efficiency, security, privacy, and device form factors. It's also the only release that includes updates to Android's NDK.

The Android 18 schedule

We're going to be moving quickly from this Beta to our Platform Stability milestone, targeted for February. At this milestone, we plan to deliver final SDK/NDK APIs and largely final app-facing behaviors. From that time you’ll have several months before the final release to complete your testing.

Screenshot 2026-12-03 at 11.55.39 AM.png

A year of releases

We plan for Android 18 to continue to get updates in a series of quarterly releases, with the upcoming release in Q2 being the only one where we introduce planned app breaking behavior changes. Continue to watch this space as we reveal more of the story of Android 18, and join the Beta program to get regular drops of new features and APIs.

Screenshot 2026-12-03 at 11.56.40 AM.png

Keeping apps fast and warm with memory updates

When a user switches away from your app to quickly snap a photo or reply to a message and returns to a cold splash screen, the culprit is usually wasted background RAM. Even as apps, games, and on-device AI workloads do more, most mainstream phones still have between 4 GB and 8 GB of RAM. Much of what evicts cached apps from memory isn't active user work. It's leftover full-resolution bitmaps from closed screens, one-time startup data, unreleased game assets held in the background, or hidden UI hierarchies pinned alongside a small background service.

In Android 18, we're extending our multi-release memory roadmap from catching extreme runaway leaks to helping keep background processes closer to their active working set. This helps more apps stay warm in RAM and resume quickly. Watch for more memory efficiency features planned in future Android 18 Beta releases.

Soft memory limits for background services in Beta 1

Many apps and games run foreground services, such as data syncs, asset downloads, media playback, or location updates, inside their main UI process. Once the user leaves the screen, that active service keeps the entire process pinned at an elevated priority, holding onto stopped Activity hierarchies, decoded images, and graphics buffers. 

Android will be rolling out per-process soft memory limits across the Android 18 Beta that apply when an app process runs a service with no visible UI. These limits are scaled by service role and device RAM.

  • Non-fatal kernel reclaim: Crossing a soft limit will not terminate your app on its own. Instead, the kernel quietly evicts cold file-backed pages (such as unused code and assets) from RAM and compresses idle private heap pages into swap (zRAM).  In upcoming Android 18 Beta builds, the platform plans to pair soft limits with app-scoped TRIM_MEMORY_RUNNING_LOW and TRIM_MEMORY_RUNNING_CRITICAL callbacks in ComponentCallbacks2.onTrimMemory(), immediate post-broadcast cached refreezing, per-process broadcast timeout budgets, and staggered non-urgent BOOT_COMPLETED delivery.
  • Covered roles: Applies to most foreground service types (such as dataSync, mediaPlayback, location, connectedDevice, and specialUse) as well as persistent system-bound services such as NotificationListenerService. When a single process holds multiple active roles simultaneously, the most generous limit applies.
  • Exemptions: Processes displaying visible UI (including split-screen and Picture-in-Picture), along with real-time capture and communication service types (camera, microphone, and phoneCall), remain exempt.

For most apps whose background service simply shares a process with leftover UI state, Android pages out untouched allocations automatically, typically with no code changes needed. Background tasks generally slow down only if the service's own active working set exceeds its soft limit, triggering page faults as evicted files reload or swapped pages decompress.

If your background service experiences memory pressure under its soft limit:

  • Release hidden UI state promptly: Decode bitmaps to exact display sizes, release hidden UI caches in Activity.onStop() (TRIM_MEMORY_UI_HIDDEN is not dispatched while an active foreground or system-bound service keeps your process running), and call stopSelf() as soon as background work completes.
  • Match architecture to workload: Media apps can keep playback in the main process while releasing unused video codecs and UI bitmap caches on backgrounding. 3D games should stream audio/asset banks on demand and unload level assets on pause. Large downloads should move to WorkManager or user-initiated data transfer jobs. Long-lived UI-free sync or messaging services can move into a lightweight worker process (such as android:process=":bg") so the main UI process freezes cleanly.

You can inspect your app's active service roles, thresholds, and live budget sources today on an Android 18 Beta 1 device via ADB:

# System thresholds and active limit stats
adb shell am memory-limiter status                    

# Process importance and active service state
adb shell dumpsys activity processes <package-name>

# Live memory usage and active budget source
adb shell dumpsys meminfo <package-name>              

For details on interpreting these outputs and managing memory budgets, see the Memory Limiter, App Memory Budgets, Android Memory Optimization Guide, and MemoryBudgetManager docs.

Because per-process soft memory limits and the new dumpsys meminfo Memory Budget section are rolling out gradually during the Beta, your Beta 1 device may not have them active on day one. If dumpsys meminfo does not yet show a Memory Budget section (or Limit Source: Process role while your service runs without visible UI), the rollout has not reached your device yet. You can still test a limit deterministically on any Beta 1 build by running:

# Test soft limits deterministically in Android 18 beta 1
adb shell am memory-limiter manual -p <pid> <size>MB

# Clear the manual limit override by passing none
adb shell am memory-limiter manual -p <pid> none

Note: Manual overrides set both the soft and hard limits to that size, so going below your app's active working set can terminate the process rather than just reclaiming memory.

Building on Android 17's memory architecture

Android 18's soft memory limits build directly on a full year of continuous platform memory and diagnostic upgrades introduced across Android 17, 17 QPR1 (SDK 37.1), and 17 QPR2 (SDK 37.2), all of which you can use today to measure, budget, and optimize your app's footprint:

  • Per-app memory limits and generational GC (Android 17): Android 17 introduced per-app hard memory limits to stop extreme runaway leaks, enforced size limits on custom notification views, and added generational garbage collection to ART's Concurrent Mark-Compact collector (delivered back to Android 12+ via Google Play system updates) to cut GC CPU overhead and pause times.
  • App Memory Budgets (MemoryBudgetManager, QPR2): While platform soft limits act as a system safety net, App Memory Budgets introduced in Android 17 QPR2 (SDK 37.2) let you declare tighter, self-defined memory targets across "foreground", "perceptible", and "background" states via <memory-budget> tags in AndroidManifest.xml (inspectable through PackageManager.getMemoryBudgets()), or manage process and package budgets dynamically via MemoryBudgetManager to prune caches proactively before system limits intervene:
val memoryBudgetManager = context.getSystemService(MemoryBudgetManager::class.java)
val usageBytes: Long = memoryBudgetManager.packageCurrentUsageBytes
val budgetBytes: Long = memoryBudgetManager.packageBudgetBytes

val cleanupThread = HandlerThread("MemoryBudgetCleanup").apply { start() }
// Register on a background Looper before tightening a dynamic process budget (e.g., 128 MB)
memoryBudgetManager.registerProcessOverBudgetListener(cleanupThread.looper) { budgetBytes ->
    trimInMemoryCaches(budgetBytes)
}
memoryBudgetManager.setProcessBudgetBytes(128L * 1024 * 1024)
  • Granular exit reasons and microsecond session tracking (Android 17 & QPR2): Android 17 QPR2 expanded ApplicationExitInfo with REASON_MEMORY_LIMITER (replacing generic REASON_OTHER "MemoryLimiter:AnonSwap" descriptions when an app exceeds per-device memory limits) and REASON_ANOMALY (flagging terminations from file-descriptor, thread, or binder leaks, alongside Android 17's structured ANR details via getAnrInfo()). Pair these with ProfilingManager triggers introduced in Android 17 (TRIGGER_TYPE_OOM and TRIGGER_TYPE_ANOMALY) and the androidx.core.os.MemorySnapshot Jetpack API. It captures resident memory and swap in microseconds across Android versions, and on Android 17 QPR2+ it reports exact process and package totals counted toward Android's budgets and limits.
  • System-level memory protections (QPR2): Under the hood, Android 17 QPR2 also introduced NPU memory preemption and buffer reuse underneath LiteRT and AICore to help keep foreground on-device AI models from triggering background app evictions, idle NotificationListenerService freezing between notification events, and in-process memory-safe software audio decoders (MediaCodecInfo.SECURITY_MODEL_MEMORY_SAFE for FLAC and MP3, joining Android 17's AAC) that help avoid isolated media-sandbox IPC overhead.

Adopting these budgeting and profiling tools also helps prepare your apps and games for Google Play's February 2027 Android Vitals quality thresholds covering memory usage (anonymous RSS + swap), background and cached bitmap memory usage, and DEX code optimization.

Time-based garbage collection triggering by default in ART

First rolled out on Pixel devices in Android 17, time-based garbage collection triggering is now enabled by default in ART on Android 18. Previously, ART scheduled concurrent garbage collection primarily from static byte-allocation watermarks controlled by seven interdependent heap-sizing properties. As a result, an app that allocated a burst of temporary objects during startup or screen transitions and then went idle could hold unreachable garbage in RAM indefinitely. ART's time-based controller instead adapts GC cadence continuously to both allocation rate and elapsed time since the previous collection, including reclaiming unused heap memory concurrently once an app goes idle. In Pixel Beta testing, time-based GC triggering helped deliver:

  • Reduced CPU time spent swapping memory (kswapd)
  • Fewer low-memory app kills
  • Fewer cold app startups on memory-constrained phones
  • Smoother UI performance with neutral battery impact

No code changes are required, though two runtime behaviors are worth keeping in mind when profiling your app:

  • Avoid manual idle System.gc() calls: ART's concurrent time-based collector automatically reclaims unreachable allocations after bursty work settles, at lower CPU overhead than explicit System.gc() invocations.
  • Don't use Runtime.totalMemory() to predict GC timing: Because ART no longer relies on a shrinking byte-utilization target to trigger collection, Runtime.totalMemory() now reports the heap growth limit (and the ART Heap Size in dumpsys meminfo appears larger), while live allocation footprint is reflected by totalMemory() - freeMemory() and Heap Alloc.

Core Runtime and App Compatibility

Alongside memory management, Android 18 Beta 1 continues expanding Android 17's concurrency and garbage collection upgrades across all apps, modernizing the Android Runtime (ART), and cleaning up legacy SDK surfaces.

Lock-free MessageQueue for all apps

In Android 17, we introduced a lock-free MessageQueue for apps targeting API level 37 or higher to help eliminate main-thread lock contention and priority inversion when background threads post work to UI handlers. Starting in Android 18 Beta 1, the legacy monitor-locked implementation is removed and android.os.MessageQueue runs lock-free for every app regardless of targetSdkVersion, alongside new fast-path consumer and wakeup optimizations. As we shared when introducing Android 17's lock-free MessageQueue, internal beta traces showed a 15% reduction in app main-thread time spent in lock contention, 4% fewer missed frames in apps, 7.7% fewer missed frames in System UI and Launcher interactions, and a 9.1% reduction in 95th-percentile time from app startup to first frame drawn. Extending this architecture to apps targeting API level 36 and lower helps bring those lock-free benefits to more apps.

Most apps benefit automatically with zero code changes. However, if you maintain an app targeting API level 36 or lower, or ship an SDK, that still uses unsupported reflection to inspect private MessageQueue fields (such as mMessages), those fields now return null on Android 18. Migrate custom main-thread watchdogs and frame monitors to public Looper logging or ProfilingManager, and update UI testing libraries such as Espresso and Robolectric to current releases.

Sealed class verification in ART

The Android Runtime now enforces OpenJDK 17 sealed class and interface restrictions when loading classes and interfaces. This also means that the SDK jars are built for Java language version 17. Previously, compilers such as javac and D8/R8 validated sealed class hierarchies at compile time and recorded permitted subclass metadata in DEX files (minSdk 34 and higher), but ART did not enforce those constraints at runtime.

When loading a class or interface, ART now verifies that:

  • A sealed class is not also marked final.
  • Any class or interface that directly extends a sealed superclass or implements a sealed interface is listed in that supertype's permitted subclasses.
  • A sealed supertype is defined by the same ClassLoader as its permitted subtype
  • Subtypes in a different package from a sealed supertype are declared public.

A class that fails these checks is rejected with a VerifyError.

If you compile your app and its dependencies together using standard build tools, your app should be unaffected in production. However, if your app:

  • Dynamically loads DEX code,
  • Uses custom ClassLoader implementations
  • Uses a sealed type and its subtypes loaded by different ClassLoaders
  • Relies on bytecode instrumentation tools that alter sealed hierarchies

Recompile dependent modules together when sealed hierarchies change and verify that your tooling preserves valid permitted-subclass metadata. You are also affected if code generates subclasses of sealed types at runtime (for example, mocking a sealed class or interface with Mockito in instrumented tests).

Disallowing synchronization on value-based classes

To prepare the runtime for future Java programming language and ART memory-layout optimizations, ART no longer permits monitor synchronization (such as synchronized blocks) on instances of value-based classes across apps running on and targeting Android 18.

Identifying impact

If you are targeting Android 18 and see a runtime exception that has a message similar to ”java.lang.Integer is not an identity class” then you are trying to synchronize on a value-based class. To find out explicit synchronization attempts in your app, you can adb push the apk to e.g. /data/local/tmp and run

dex2oat --dex-file=/data/local/tmp/app.apk
--oat-file=/data/local/tmp/output.oat

in the adb shell session. Then in adb logcat you’ll see entries such as:

10-02 13:33:40.062  3608  3629 W dex2oat : void edt.b(): 
monitor-enter on value-class (Ljava/lang/Boolean;).

Make sure you’re testing the same APK that will be distributed to users, with all obfuscation libraries and frameworks applied.

What you need to do

You should instead use an object that is an instance of a non-value class. For example, you can replace code such as this:

    private Integer lock = new Integer(1);
    ...
    synchronized (lock) { ... }

with code that uses non-value classes for synchronization:

    private final Object lock = new Object();
    ...
    synchronized (lock) { ... }

SDK deprecations and compile-time cleanup

Media and Photo Picker

Android 18 Beta 1 expands developer control over embedded media selection and improves image format compatibility in Photo Picker.

New customizable navigation options in the Embedded Photo Picker

We've added new APIs to android.widget.photopicker that give host apps finer control over navigation and user actions inside an Embedded Photo Picker session:

val uiParams = EmbeddedPhotoPickerUiCustomizationParams.Builder()
    .setNavigationBarVisibleInExpandedMode(true)
    .setSearchBarVisibleInExpandedMode(false)
    .build()

val featureInfo = EmbeddedPhotoPickerFeatureInfo.Builder()
    .setAllowedNavigationTabs(
        setOf(
            NavigationTabConstants.NAV_TAB_PHOTOS,
            NavigationTabConstants.NAV_TAB_COLLECTIONS
        )
    )
    .setEmbeddedUiCustomizationParams(uiParams)
    .setCameraButtonEnabled(true)
    .build()

On-the-fly HEIF to JPEG conversion in Photo Picker

When a user launches the Photo Picker activity from your app and previews a HEIF or HEIC photo, a new Use supported format option in the preview menu lets them convert selected images to JPEG on the fly. Converted copies are stored in a temporary on-device system cache without altering the user's original gallery items, preserve key EXIF metadata (including location, subject to standard sharing restrictions), and return a standard JPEG URI to your app with no code changes required. Because conversion is user-selected per photo and falls back to the original file if a conversion times out, your app should continue handling HEIF/HEIC inputs where supported.

On-Device Search and System I/O

Pre-quantized embeddings and multi-signer packages in AppSearch

AppSearch introduces two enhancements in android.app.appsearch:

File access hints with Os.posix_fadvise

Android 18 exposes Os.posix_fadvise() and its accompanying OsConstants (POSIX_FADV_NORMAL, POSIX_FADV_SEQUENTIAL, POSIX_FADV_RANDOM, POSIX_FADV_WILLNEED, POSIX_FADV_DONTNEED, and POSIX_FADV_NOREUSE) directly to managed code. Apps that manage large media files, databases, or on-device ML model weights can declare expected file access patterns, and advise the kernel when pages are no longer needed, to optimize page-cache behavior without custom JNI wrappers.

Privacy and Security

Restrict implicit URI grants

Previously, when an app sent an ACTION_SEND or ACTION_SEND_MULTIPLE intent with content URIs in EXTRA_STREAM, the system automatically granted the receiving app read access to them. For ACTION_IMAGE_CAPTURE and related capture actions, it granted read and write access to the URI in EXTRA_OUTPUT. Starting in Android 18, the system no longer adds these grants when the sending app targets Android 18 (API level 38) or higher.

Beta 1 doesn't enforce the restriction yet. To find affected intents, turn on detectImplicitUriPermissionGrant() in StrictMode, available since Android 17, or look for Please set the grant explicitly in the app in logcat. Then add Intent.FLAG_GRANT_READ_URI_PERMISSION to send intents, and both FLAG_GRANT_READ_URI_PERMISSION and FLAG_GRANT_WRITE_URI_PERMISSION to capture intents. If your app receives these intents, handle the case where the sender didn't grant access. For details, see Restrict implicit URI grants.

Rust PNG codec in Skia

Under the hood, Android's graphics stack now uses a Rust PNG implementation in Skia in place of the previous C++ libpng library when decoding and encoding PNGs and PNG-embedded ICO files. This drop-in replacement is designed to preserve pixel and feature parity, including NinePatch assets, gainmaps, and HDR metadata, while helping harden apps against memory-corruption vulnerabilities when rendering untrusted image data.

Adaptive UI, Form Factors, and System Integration

Standardized default system font customization

Device manufacturers can now customize the default system typeface through a standardized platform mechanism so generic font families such as sans-serif dynamically map to the configured font across both System UI and apps. Avoid hardcoding fixed container heights, strict line counts, or layout calculations tailored to Roboto glyph metrics. Building flexible text layouts helps your UI adapt cleanly across devices to avoid clipping or unexpected wrapping.

Desktop windowing and input refinements

  • Desktop windowing rotation continuity: Rotating a device during a desktop windowing session (such as on a tablet or a phone connected to an external display) now proportionally repositions freeform windows within visible bounds and preserves left/right tiled split layouts, making responsive resize handling and state restoration increasingly important.
  • New hardware input keycodes: The input framework adds mappings for new hardware keys, including the USB HID Contextual Assistance specification. Apps with custom hardware keyboard handlers should verify they handle newly introduced keycodes gracefully.

Health Connect and web apps

  • Manage Health Connect permissions in-app: Apps can launch HealthConnectManager.ACTION_SHOW_HEALTH_PERMISSIONS (optionally passing Intent.EXTRA_PACKAGE_NAME) to send users to the Health Connect permission settings page. When EXTRA_PACKAGE_NAME is provided for an app that already has at least one granted health permission, it navigates directly to that app's permission screen; otherwise, it opens the Connected apps list.
  • On-device Web App Installer enabled by default: The system Web App Installer service is now enabled out of the box (removing the previous Developer options toggle), enabling browsers to package and install Progressive Web Apps as standalone Trusted Web Activities directly on the device.

Get started with Android 18

You can enroll an eligible Pixel device today to receive Android 18 Beta 1 and upcoming biweekly Beta updates over-the-air. If you don't have a supported Pixel device, you can use the 64-bit system images with the Android Emulator in Android Studio.

If you are already enrolled in the Android Beta program, your device will automatically be offered an over-the-air update to Android 18 Beta 1. 

If your device is currently running Android 17 QPR3 Beta and you prefer to receive the final stable public release of QPR3 and exit the Beta program without wiping your data, do not install the Android 18 Beta 1 update. Instead:

  • Opt out at google.com/android/beta
  • Ignore the downgrade OTA update
  • Wait for the stable public Android 17 QPR3 release.

To develop and test with Android 18, we recommend using the latest preview of Android Studio (Stingray). Once you're set up, here are the first steps to take:

  • Test your active working set and runtime compatibility: Install your current app on a Pixel device or Android Emulator running Android 18 Beta 1 to evaluate background services under soft memory limits (adb shell am memory-limiter status), calibrate App Memory Budgets, and test against universal lock-free MessageQueue behavior (especially in pre-API-37 apps or SDKs that reflect on MessageQueue), ART sealed-class verification, and StrictMode detection of implicit URI grants.
  • Compile against the preview SDK, integrate with your CI workflows, and try out new APIs.
  • Report issues and requests through our developer feedback page. The earlier we hear from you in our biweekly Beta cycle, the more feedback we can incorporate ahead of Platform Stability and the final release.

We plan to update the preview/beta system images and SDK on a regular biweekly cadence throughout the Android 18 release cycle. For complete details on build DP21.261120.004, visit the Android 18 developer site.

Join the conversation

As we kick off the road to Platform Stability and the major release of Android 18 next year, make sure to stay tuned for more on Android 18's new features, APIs, and planned behavior changes. Whether you're testing bleeding-edge builds on the Android Canary channel or validating your apps on Android 18 Beta, thank you in advance for sharing your feedback with us. We're listening!

Written by:
Continue reading