November 2022 deprecated camera methods removal for ARCore SDK for Android NDK (C)

In November 2022, Google Play Services for AR will remove deprecated methods related to NDK camera images and metadata.

Apps using these methods in affected versions of the ARCore SDK might start to behave differently or crash when users update Google Play Services for AR.

Affected apps

Beginning in November 2022, your app may stop working or crash when users update to the latest version of Google Play Services for AR if:

  1. Your app was compiled with an affected SDK
  2. Your app uses any of the following affected APIs:
If your app was compiled with
ARCore SDK version…
And uses affected APIs… Breaking behavior starting in November 2022
1.22.0 or lower ArImage_getNdkImage()
(removed in ARCore SDK 1.23.0)
Returns NULL in the resulting AImage struct.
1.22.0 or lower ArImage_getNdkCameraMetadata()
(removed in ARCore SDK 1.23.0)
Returns NULL in the resulting ACameraMetadata struct.

Fix affected apps

Affected apps may see breakage in November 2022. To mitigate this, use drop-in replacements for affected methods:

Verify affected app is fixed

Test the app by simulating the November 2022 changes in advance by adding a special meta-data entry to your app's AndroidManifest.xml:

  1. Ensure Play Services for AR version 1.29.0 or higher is installed on the target device.
  2. Add a new <meta-data> tag as a child of the existing <application> element in the app's AndroidManifest.xml file :

    <application …>
      …
    
      <!--
           Simulate the November 2022 changes in advance.
           IMPORTANT: Remove this tag when testing is completed.
           Do not include this tag in published versions of your app.
      -->
      <meta-data android:name="com.google.ar.core.session_settings"
                 android:value="camera_stack_option,unified_mono" />
    </application>
    
  3. Test your app and verify that all ARCore features are functioning as expected.

  4. Remove the <meta-data> tag when testing is complete. Leaving this tag in place in your published app could result in unexpected behavior in the future.

If the app functions normally, then the app is ready for the changes in November 2022.

Timeline

Period Events
November 2020
(ARCore SDK version 1.20.0)
Deprecate affected APIs, introduce drop-in API alternatives.
February 2021
(ARCore SDK version 1.23.0)
Remove previously deprecated APIs signatures from ARCore SDK.
November 2021 Announce future breaking change due to pending removal of implementation of affected APIs from Google Play Services for AR in November 2022.
November 2022 Remove implementation of affected APIs from Google Play Services for AR.
Introduce breaking change for apps using ARCore versions prior to 1.23.0.