Android 18 Will Disable the Legacy Camera1 API for Apps Targeting API 38, Affecting QR Code Scanning
The article's text, from Joho no Todai's page.
On December 4, 2026, U.S. time, Google announced the first Android 18 beta.
Google’s documentation for developers says it plans to disable Android’s legacy camera API, android.hardware.Camera (Camera1). The change applies to apps that target API level 38 (Android 18) or higher when running on Android 18.
Under the planned behavior, the camera service will refuse to initialize the camera when an affected app calls Camera.open(). This will throw a RuntimeException.
Calls to Camera.getNumberOfCameras(), which returns the number of cameras, will also return zero. The legacy API will report zero cameras even on devices with camera hardware. Some programs may conclude there is no camera and stop before attempting to open one.
Camera1 was deprecated in Android 5.0, when developers were encouraged to migrate to android.hardware.camera2 (Camera2). Camera1 lacks support for modern multi-camera configurations, HDR video capture, simultaneous streams from multiple cameras, and per-frame manual sensor controls. Google recommends Jetpack CameraX, which is built on Camera2.
QR code scanning libraries can still depend on the old API
Google asks developers to check both their app source code and third-party libraries and software development kits (SDKs) for legacy API dependencies. Examples include older QR code and barcode scanning libraries, document capture SDKs, and WebRTC libraries.
One such library is ZXing Android Embedded, an open-source library that adds barcode and QR code scanning to Android apps. The project’s releases page lists v4.3.0, released in 2021, as the latest version.
In v4.3.0, the camera selection code calls Camera.getNumberOfCameras() to count the cameras. If it finds zero, it returns -1 as the camera ID. The code that opens the camera skips Camera.open() and returns null (no camera reference).
The CameraManager gets null and throws a RuntimeException. The higher-level CameraInstance catches the exception and reports the error if an error handler has been configured.
Applying the planned restrictions for apps targeting API level 38 or higher on Android 18 to this released code suggests that initialization will fail when the reported camera count is zero and the scanner will fail to start. The library catches the exception, so whether the entire app crashes also depends on how the app handles the error.
Android 18’s planned Camera1 shutdown and its impact on QR scanning
| Operation | Camera1 (planned) | ZXing Android Embedded v4.3.0 (expected) |
|---|---|---|
| Apps targeting API level 38 or higher on Android 18 | ||
| Camera count | Returns zero cameras | Returns camera ID -1 |
| Initialization | Initialization denied with a runtime exception | Skips Camera.open() and returns null |
| ZXing initialization fails with a runtime exception QR code scanning is expected to fail to start | ||
QR code decoding can work correctly and still be unusable if the app cannot capture an image. The library chosen to manage the camera can determine whether the app works on a given OS version.
In Japan, CPoint Lab published a QR scanning implementation using v3.6.0 in 2021. Japanese-language developer documentation updated in 2025 also describes integrating v4.3.0. The library appears in Japanese implementation examples, making its camera code worth checking when maintaining apps that use it.
The implementation was chosen to keep older devices working
A proposal to migrate ZXing Android Embedded to Camera2 dates back to 2015. A developer acknowledged the new API’s advantages, such as using different resolutions for preview and scanning, and cited the need to keep supporting older Android devices.
In 2019, a developer said there were no plans to migrate at the time because the existing camera implementation worked and moving to Camera2 could introduce new device-specific problems.
It was a decision made to preserve compatibility. Replacing working camera code carries a risk of introducing bugs during the transition. As long as the deprecated API remained available, continuing to use it made sense.
If the Android 18 change goes ahead, the conditions behind that decision will change. Keeping the old API could make it harder to support newer versions of Android.
An OS update and an app update can have different effects
The setting that matters for this change is the app’s targetSdkVersion, or target API level. The separate minSdkVersion setting specifies the oldest Android API level that can run the app, so raising the target API level can still allow support for older devices.
Target API levels and the planned Camera1 shutdown
| Category | Target API level | Requirement or outcome |
|---|---|---|
| Google Play (2026, smartphones) | ||
| Existing apps | 35 or higher | Devices running newer Android versions Availability to new users |
| New apps and updates | 36 or higher | Required at submission |
| Camera1 shutdown on Android 18 (planned) | ||
| Use of the legacy API | Below 38 | Outside the scope of the change |
| 38 or higher | Subject to the shutdown | |
Under Google’s plan, Camera1 will be disabled for apps with a targetSdkVersion of 38 or higher on Android 18. An existing app that targets an API level below 38 remains outside the scope of this change even when a user moves to an Android 18 device.
One reason developers raise an app’s target API level is to meet Google Play’s distribution requirements.
Under Google Play’s target API level requirements, starting August 31, 2026, new apps and updates submitted for standard smartphones must target Android 16 (API level 36) or later. Existing apps for standard smartphones must target Android 15 (API level 35) or later to remain available to new users on Android versions above the app’s target API level.
If Google Play eventually raises the target for new submissions and updates to API level 38 or higher, apps that still depend on Camera1 will have difficulty keeping camera features working on Android 18. The cutoff for using the legacy API and the store’s minimum target for updates will then overlap.
Migrating camera control and scanner logic
Google is asking developers using Camera1 to migrate to Camera2 or Jetpack CameraX. Its guide to migrating to CameraX explains how implementation differs from the old API.
According to Google’s guide, CameraX supports Android 5.0 and later and provides camera preview, still photography, video capture, and image analysis. It also handles device rotation and camera control when an app moves to the background.
For QR codes, one option is to combine CameraX image analysis with scanning logic. Even if the app itself makes no legacy API calls, a library it bundles may open the camera internally. Developers need to check the code they depend on and test scanning, camera switching, screen rotation, and error handling.
Google plans to refresh the Android 18 beta about every two weeks and reach platform stability in February 2027. The major Android 18 release is scheduled for the second quarter of 2027.
For developers whose apps rely on Camera1, it is nearly time to revisit camera control even if they have no new camera features planned. Keeping a familiar feature like QR code scanning working on a new version of Android will require changing how the app connects to the camera.
