ARCore Android SDK v1.56.0
diff --git a/libraries/include/arcore_c_api.h b/libraries/include/arcore_c_api.h
index 5a03e56..3767c26 100644
--- a/libraries/include/arcore_c_api.h
+++ b/libraries/include/arcore_c_api.h
@@ -1740,6 +1740,9 @@
     /// @c ::ArSession_isGeospatialModeSupported to check if the current device
     /// and selected camera support enabling this mode.
     AR_GEOSPATIAL_MODE_ENABLED = 2,
+    /// A hint for low-power geospatial tracking where quality may be reduced
+    /// but battery life improved.
+    AR_GEOSPATIAL_MODE_INERTIAL = 3,
 };
 
 /// @ingroup ArConfig
@@ -5064,6 +5067,79 @@
                                          ArImage **out_depth_image);
 
 /// @ingroup ArFrame
+/// Attempts to acquire a depth image that corresponds to the current frame.
+///
+/// The depth image has format <a
+/// href="https://developer.android.com/reference/android/hardware/HardwareBuffer#D_FP32">
+/// HardwareBuffer.D_FP32</a>, which is a single 32-bit plane at index 0,
+/// stored in little-endian format. Each pixel contains the distance in
+/// meters along the camera principal axis, with the representable depth
+/// range between 0 meters and about 65 meters.
+///
+/// To extract distance from a depth map, see <a
+/// href="https://developers.google.com/ar/develop/c/depth/developer-guide#extract-distance">the
+/// Depth API developer guide</a>.
+////
+/// The actual size of the depth image depends on the device and its display
+/// aspect ratio. The size of the depth image is typically around 160x120
+/// pixels, with higher resolutions up to 640x480 on some devices. These sizes
+/// may change in the future. The outputs of
+/// @c ::ArFrame_acquireDepthImageMeters,
+/// @c ::ArFrame_acquireRawDepthImageMeters and
+/// @c ::ArFrame_acquireRawDepthConfidenceImage will all have the exact same
+/// size.
+///
+/// Optimal depth accuracy is achieved between .5 meters (50 centimeters)
+/// and 15 meters from the camera, with depth reliably
+/// observed up to 25 meters. Error increases quadratically
+/// as distance from the camera increases.
+///
+/// Depth is estimated using data from the world-facing cameras, user motion,
+/// and hardware depth sensors such as a time-of-flight sensor (or ToF sensor)
+/// if available. As the user moves their device through the environment, 3D
+/// depth data is collected and cached which improves the quality of subsequent
+/// depth images and reducing the error introduced by camera distance.
+///
+/// If an up-to-date depth image isn't ready for the current frame, the most
+/// recent depth image available from an earlier frame will be returned instead.
+/// This is expected only to occur on compute-constrained devices. An up-to-date
+/// depth image should typically become available again within a few frames.
+///
+/// When the Geospatial API and the Depth API are enabled, output images
+/// from the Depth API will include terrain and building geometry when in a
+/// location with VPS coverage. See the <a
+/// href="https://developers.google.com/ar/develop/c/depth/geospatial-depth">Geospatial
+/// Depth Developer Guide</a> for more information.
+///
+/// The image must be released with @c ::ArImage_release once it is no
+/// longer needed.
+///
+/// @param[in]  session                The ARCore session.
+/// @param[in]  frame                  The current frame.
+/// @param[out] out_depth_image        On successful return, this is filled out
+///     with a pointer to an @c ::ArImage. On error return, this is filled out
+///     with @c nullptr.
+/// @return @c #AR_SUCCESS or any of:
+/// - @c #AR_ERROR_INVALID_ARGUMENT if the session, frame, or depth image
+///   arguments are invalid.
+/// - @c #AR_ERROR_NOT_YET_AVAILABLE if the number of observed camera frames is
+///   not yet sufficient for depth estimation; or depth estimation was not
+///   possible due to poor lighting, camera occlusion, or insufficient motion
+///   observed.
+/// - @c #AR_ERROR_NOT_TRACKING The session is not in the
+///   @c #AR_TRACKING_STATE_TRACKING state, which is required to acquire depth
+///   images.
+/// - @c #AR_ERROR_ILLEGAL_STATE if a supported depth mode was not enabled in
+///   Session configuration.
+/// - @c #AR_ERROR_RESOURCE_EXHAUSTED if the caller app has exceeded maximum
+///   number of depth images that it can hold without releasing.
+/// - @c #AR_ERROR_DEADLINE_EXCEEDED if the provided Frame is not the current
+///   one.
+ArStatus ArFrame_acquireDepthImageMeters(const ArSession *session,
+                                         const ArFrame *frame,
+                                         ArImage **out_depth_image);
+
+/// @ingroup ArFrame
 /// Attempts to acquire a "raw", mostly unfiltered, depth image that corresponds
 /// to the current frame.
 ///
@@ -5242,6 +5318,94 @@
                                             ArImage **out_depth_image);
 
 /// @ingroup ArFrame
+/// Attempts to acquire a "raw", mostly unfiltered, depth image that corresponds
+/// to the current frame.
+///
+/// The raw depth image is sparse and does not provide valid depth for all
+/// pixels. Pixels without a valid depth estimate have a pixel value of 0 and a
+/// corresponding confidence value of 0 (see
+/// @c ::ArFrame_acquireRawDepthConfidenceImage).
+///
+/// The depth image has format <a
+/// href="https://developer.android.com/reference/android/hardware/HardwareBuffer#D_FP32">
+/// HardwareBuffer.D_FP32</a>, which is a single 32-bit plane at index 0,
+/// stored in little-endian format. Each pixel contains the distance in
+/// meters along the camera principal axis, with the representable depth
+/// range between 0 meters and about 65 meters.
+///
+/// To extract distance from a depth map, see <a
+/// href="https://developers.google.com/ar/develop/c/depth/developer-guide#extract-distance">the
+/// Depth API developer guide</a>.
+///
+/// The actual size of the depth image depends on the device and its display
+/// aspect ratio. The size of the depth image is typically around 160x120
+/// pixels, with higher resolutions up to 640x480 on some devices. These sizes
+/// may change in the future. The outputs of
+/// @c ::ArFrame_acquireDepthImageMeters,
+/// @c ::ArFrame_acquireRawDepthImageMeters and
+/// @c ::ArFrame_acquireRawDepthConfidenceImage will all have the exact same
+/// size.
+///
+/// Optimal depth accuracy is achieved between .5 meters (50 centimeters)
+/// and 15 meters from the camera, with depth reliably
+/// observed up to 25 meters. Error increases quadratically
+/// as distance from the camera increases.
+///
+/// Depth is primarily estimated using data from the motion of world-facing
+/// cameras. As the user moves their device through the environment, 3D depth
+/// data is collected and cached, improving the quality of subsequent depth
+/// images and reducing the error introduced by camera distance. Depth accuracy
+/// and robustness improves if the device has a hardware depth sensor, such as a
+/// time-of-flight (ToF) camera.
+///
+/// Not every raw depth image contains a new depth estimate. Typically there are
+/// about 10 updates to the raw depth data per second. The depth images between
+/// those updates are a 3D reprojection which transforms each depth pixel into a
+/// 3D point in space and renders those 3D points into a new raw depth image
+/// based on the current camera pose. This effectively transforms raw depth
+/// image data from a previous frame to account for device movement since the
+/// depth data was calculated. For some applications it may be important to know
+/// whether the raw depth image contains new depth data or is a 3D reprojection
+/// (for example, to reduce the runtime cost of 3D reconstruction). To do that,
+/// compare the current raw depth image timestamp, obtained via @c
+/// ::ArImage_getTimestamp, with the previously recorded raw depth image
+/// timestamp. If they are different, the depth image contains new information.
+///
+/// When the Geospatial API and the Depth API are enabled, output images
+/// from the Depth API will include terrain and building geometry when in a
+/// location with VPS coverage. See the <a
+/// href="https://developers.google.com/ar/develop/c/depth/geospatial-depth">Geospatial
+/// Depth Developer Guide</a> for more information.
+///
+/// The image must be released via @c ::ArImage_release once it is no longer
+/// needed.
+///
+/// @param[in]  session                The ARCore session.
+/// @param[in]  frame                  The current frame.
+/// @param[out] out_depth_image        On successful return, this is filled out
+///   with a pointer to an @c ::ArImage. On error return, this is filled out
+///   filled out with @c nullptr.
+/// @return @c #AR_SUCCESS or any of:
+/// - @c #AR_ERROR_INVALID_ARGUMENT if the session, frame, or depth image
+///   arguments are invalid.
+/// - @c #AR_ERROR_NOT_YET_AVAILABLE if the number of observed camera frames is
+///   not yet sufficient for depth estimation; or depth estimation was not
+///   possible due to poor lighting, camera occlusion, or insufficient motion
+///   observed.
+/// - @c #AR_ERROR_NOT_TRACKING The session is not in the
+///   @c #AR_TRACKING_STATE_TRACKING state, which is required to acquire depth
+///   images.
+/// - @c #AR_ERROR_ILLEGAL_STATE if a supported depth mode was not enabled in
+///   Session configuration.
+/// - @c #AR_ERROR_RESOURCE_EXHAUSTED if the caller app has exceeded maximum
+///   number of depth images that it can hold without releasing.
+/// - @c #AR_ERROR_DEADLINE_EXCEEDED if the provided @c ::ArFrame is not the
+///   current one.
+ArStatus ArFrame_acquireRawDepthImageMeters(const ArSession *session,
+                                            const ArFrame *frame,
+                                            ArImage **out_depth_image);
+
+/// @ingroup ArFrame
 /// Attempts to acquire the confidence image corresponding to the raw depth
 /// image of the current frame.
 ///
@@ -5620,6 +5784,13 @@
     /// href="https://developer.android.com/reference/android/hardware/HardwareBuffer#D_16">D_16</a>.
     AR_IMAGE_FORMAT_D_16 = 0x00000030,
 
+    /// Produced by @c ::ArFrame_acquireDepthImageMeters and
+    /// @c ::ArFrame_acquireRawDepthImageMeters.
+    /// Depth range values in units of meters.
+    /// Floating point value equal to <a
+    /// href="https://developer.android.com/reference/android/hardware/HardwareBuffer#D_FP32">D_FP32</a>.
+    AR_IMAGE_FORMAT_D_FP32 = 0x00000033,
+
     /// Produced by @c ::ArFrame_acquireRawDepthConfidenceImage. Integer value
     /// equal to @c <a
     /// href="https://developer.android.com/reference/android/graphics/ImageFormat.html#Y8">Y8</a>.
diff --git a/samples/augmented_faces_java/app/build.gradle b/samples/augmented_faces_java/app/build.gradle
index e588e41..8be38c4 100644
--- a/samples/augmented_faces_java/app/build.gradle
+++ b/samples/augmented_faces_java/app/build.gradle
@@ -17,14 +17,14 @@
 
 android {
     namespace "com.google.ar.core.examples.java.augmentedfaces"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.java.augmentedfaces"
 
         // AR Optional apps must declare minSdkVersion >= 14.
         // AR Required apps must declare minSdkVersion >= 24.
         minSdkVersion 24
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
     }
@@ -42,7 +42,7 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
 
     // Obj - a simple Wavefront OBJ file loader
     // https://github.com/javagl/Obj
diff --git a/samples/augmented_faces_java/gradle/wrapper/gradle-wrapper.jar b/samples/augmented_faces_java/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/augmented_faces_java/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/augmented_faces_java/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/augmented_faces_java/gradlew b/samples/augmented_faces_java/gradlew
index 23d15a9..249efbb 100755
--- a/samples/augmented_faces_java/gradlew
+++ b/samples/augmented_faces_java/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/augmented_faces_java/gradlew.bat b/samples/augmented_faces_java/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/augmented_faces_java/gradlew.bat
+++ b/samples/augmented_faces_java/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/augmented_image_c/app/build.gradle b/samples/augmented_image_c/app/build.gradle
index d5cf673..fb71fa5 100644
--- a/samples/augmented_image_c/app/build.gradle
+++ b/samples/augmented_image_c/app/build.gradle
@@ -26,14 +26,14 @@
 
 android {
     namespace "com.google.ar.core.examples.c.augmentedimage"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.c.augmentedimage"
 
         // "AR Optional" apps must declare minSdkVersion >= 14.
         // "AR Required" apps must declare minSdkVersion >= 24.
         minSdkVersion 24
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
 
@@ -69,8 +69,8 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
-    natives 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
+    natives 'com.google.ar:core:1.56.0'
 
     implementation 'androidx.appcompat:appcompat:1.1.0'
     implementation 'com.google.android.material:material:1.1.0'
diff --git a/samples/augmented_image_c/gradle/wrapper/gradle-wrapper.jar b/samples/augmented_image_c/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/augmented_image_c/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/augmented_image_c/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/augmented_image_c/gradlew b/samples/augmented_image_c/gradlew
index 23d15a9..249efbb 100755
--- a/samples/augmented_image_c/gradlew
+++ b/samples/augmented_image_c/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/augmented_image_c/gradlew.bat b/samples/augmented_image_c/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/augmented_image_c/gradlew.bat
+++ b/samples/augmented_image_c/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/augmented_image_java/app/build.gradle b/samples/augmented_image_java/app/build.gradle
index 71699f7..23a51fd 100644
--- a/samples/augmented_image_java/app/build.gradle
+++ b/samples/augmented_image_java/app/build.gradle
@@ -17,14 +17,14 @@
 
 android {
     namespace "com.google.ar.core.examples.java.augmentedimage"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.java.augmentedimage"
 
         // "AR Optional" apps must declare minSdkVersion >= 14.
         // "AR Required" apps must declare minSdkVersion >= 24.
         minSdkVersion 24
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
     }
@@ -42,7 +42,7 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
 
     // Obj - a simple Wavefront OBJ file loader
     // https://github.com/javagl/Obj
diff --git a/samples/augmented_image_java/gradle/wrapper/gradle-wrapper.jar b/samples/augmented_image_java/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/augmented_image_java/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/augmented_image_java/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/augmented_image_java/gradlew b/samples/augmented_image_java/gradlew
index 23d15a9..249efbb 100755
--- a/samples/augmented_image_java/gradlew
+++ b/samples/augmented_image_java/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/augmented_image_java/gradlew.bat b/samples/augmented_image_java/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/augmented_image_java/gradlew.bat
+++ b/samples/augmented_image_java/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/cloud_anchor_java/app/build.gradle b/samples/cloud_anchor_java/app/build.gradle
index d945522..adf9e04 100644
--- a/samples/cloud_anchor_java/app/build.gradle
+++ b/samples/cloud_anchor_java/app/build.gradle
@@ -17,14 +17,14 @@
 
 android {
     namespace "com.google.ar.core.examples.java.cloudanchor"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.java.cloudanchor"
 
         // "AR Optional" apps must declare minSdkVersion >= 14.
         // "AR Required" apps must declare minSdkVersion >= 24.
         minSdkVersion 24
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
     }
@@ -42,7 +42,7 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
 
     // Obj - a simple Wavefront OBJ file loader
     // https://github.com/javagl/Obj
diff --git a/samples/cloud_anchor_java/gradle/wrapper/gradle-wrapper.jar b/samples/cloud_anchor_java/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/cloud_anchor_java/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/cloud_anchor_java/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/cloud_anchor_java/gradlew b/samples/cloud_anchor_java/gradlew
index 23d15a9..249efbb 100755
--- a/samples/cloud_anchor_java/gradlew
+++ b/samples/cloud_anchor_java/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/cloud_anchor_java/gradlew.bat b/samples/cloud_anchor_java/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/cloud_anchor_java/gradlew.bat
+++ b/samples/cloud_anchor_java/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/computervision_c/app/build.gradle b/samples/computervision_c/app/build.gradle
index dd7b247..37005a1 100644
--- a/samples/computervision_c/app/build.gradle
+++ b/samples/computervision_c/app/build.gradle
@@ -26,14 +26,14 @@
 
 android {
     namespace "com.google.ar.core.examples.c.computervision"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.c.computervision"
 
         // "AR Optional" apps must declare minSdkVersion >= 14.
         // "AR Required" apps must declare minSdkVersion >= 24.
         minSdkVersion 24
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
 
@@ -69,8 +69,8 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
-    natives 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
+    natives 'com.google.ar:core:1.56.0'
 
     implementation 'androidx.appcompat:appcompat:1.1.0'
     implementation 'com.google.android.material:material:1.1.0'
diff --git a/samples/computervision_c/gradle/wrapper/gradle-wrapper.jar b/samples/computervision_c/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/computervision_c/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/computervision_c/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/computervision_c/gradlew b/samples/computervision_c/gradlew
index 23d15a9..249efbb 100755
--- a/samples/computervision_c/gradlew
+++ b/samples/computervision_c/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/computervision_c/gradlew.bat b/samples/computervision_c/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/computervision_c/gradlew.bat
+++ b/samples/computervision_c/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/computervision_java/app/build.gradle b/samples/computervision_java/app/build.gradle
index 88f660a..13902ae 100644
--- a/samples/computervision_java/app/build.gradle
+++ b/samples/computervision_java/app/build.gradle
@@ -17,14 +17,14 @@
 
 android {
     namespace "com.google.ar.core.examples.java.computervision"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.java.computervision"
 
         // "AR Optional" apps must declare minSdkVersion >= 14.
         // "AR Required" apps must declare minSdkVersion >= 24.
         minSdkVersion 24
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
     }
@@ -42,7 +42,7 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
 
     // Obj - a simple Wavefront OBJ file loader
     // https://github.com/javagl/Obj
diff --git a/samples/computervision_java/app/src/main/java/com/google/ar/core/examples/java/computervision/ComputerVisionActivity.java b/samples/computervision_java/app/src/main/java/com/google/ar/core/examples/java/computervision/ComputerVisionActivity.java
index 3d5b8c1..580d251 100644
--- a/samples/computervision_java/app/src/main/java/com/google/ar/core/examples/java/computervision/ComputerVisionActivity.java
+++ b/samples/computervision_java/app/src/main/java/com/google/ar/core/examples/java/computervision/ComputerVisionActivity.java
@@ -54,6 +54,7 @@
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Comparator;
 import java.util.EnumSet;
 import java.util.List;
 import javax.microedition.khronos.egl.EGLConfig;
@@ -505,16 +506,17 @@
       List<CameraConfig> cameraConfigs = session.getSupportedCameraConfigs(cameraConfigFilter);
       Log.i(TAG, "Size of supported CameraConfigs list is " + cameraConfigs.size());
 
+      List<CameraConfig> distinctResolutionConfigs = getSortedDistinctCameraConfigs(cameraConfigs);
+      if (distinctResolutionConfigs.isEmpty()) {
+        return;
+      }
+
       // Determine the highest and lowest CPU resolutions.
-      cpuLowResolutionCameraConfig =
-          getCameraConfigWithSelectedResolution(
-              cameraConfigs, /*ImageResolution*/ ImageResolution.LOW_RESOLUTION);
+      cpuLowResolutionCameraConfig = distinctResolutionConfigs.get(0);
       cpuMediumResolutionCameraConfig =
-          getCameraConfigWithSelectedResolution(
-              cameraConfigs, /*ImageResolution*/ ImageResolution.MEDIUM_RESOLUTION);
+          distinctResolutionConfigs.get(distinctResolutionConfigs.size() / 2);
       cpuHighResolutionCameraConfig =
-          getCameraConfigWithSelectedResolution(
-              cameraConfigs, /*ImageResolution*/ ImageResolution.HIGH_RESOLUTION);
+          distinctResolutionConfigs.get(distinctResolutionConfigs.size() - 1);
       // Update the radio buttons with the resolution info.
       updateRadioButtonText(
           R.id.radio_low_res, cpuLowResolutionCameraConfig, getString(R.string.label_low_res));
@@ -534,31 +536,39 @@
     radioButton.setText(prefix + " (" + resolution.getWidth() + "x" + resolution.getHeight() + ")");
   }
 
-  /* Get the CameraConfig with selected resolution. */
-  private static CameraConfig getCameraConfigWithSelectedResolution(
-      List<CameraConfig> cameraConfigs, ImageResolution resolution) {
-    // Take the first three camera configs, if camera configs size are larger than 3.
-    List<CameraConfig> cameraConfigsByResolution =
-        new ArrayList<>(
-            cameraConfigs.subList(0, Math.min(cameraConfigs.size(), 3)));
-    Collections.sort(
-        cameraConfigsByResolution,
-        (CameraConfig p1, CameraConfig p2) ->
-            Integer.compare(p1.getImageSize().getHeight(), p2.getImageSize().getHeight()));
-    CameraConfig cameraConfig = cameraConfigsByResolution.get(0);
-    switch (resolution) {
-      case LOW_RESOLUTION:
-        cameraConfig = cameraConfigsByResolution.get(0);
-        break;
-      case MEDIUM_RESOLUTION:
-        // There are some devices that medium resolution is the same as high resolution.
-        cameraConfig = cameraConfigsByResolution.get(1);
-        break;
-      case HIGH_RESOLUTION:
-        cameraConfig = cameraConfigsByResolution.get(2);
-        break;
+  /* Get sorted distinct CameraConfigs. */
+  private static List<CameraConfig> getSortedDistinctCameraConfigs(
+      List<CameraConfig> cameraConfigs) {
+    if (cameraConfigs.isEmpty()) {
+      return Collections.emptyList();
     }
-    return cameraConfig;
+    // Sort camera configs by resolution area (width * height) ascending.
+    // Use target FPS descending as a secondary tie-breaker for identical resolutions.
+    List<CameraConfig> cameraConfigsByResolution = new ArrayList<>(cameraConfigs);
+    cameraConfigsByResolution.sort(
+        Comparator.comparingInt(
+                (CameraConfig c) -> c.getImageSize().getWidth() * c.getImageSize().getHeight())
+            .thenComparing(
+                Comparator.comparingInt((CameraConfig c) -> c.getFpsRange().getUpper()).reversed())
+            .thenComparing(
+                Comparator.comparingInt((CameraConfig c) -> c.getFpsRange().getLower())
+                    .reversed()));
+
+    // Filter to distinct image resolutions (preserving order from smallest to largest).
+    List<CameraConfig> distinctResolutionConfigs = new ArrayList<>();
+    for (CameraConfig config : cameraConfigsByResolution) {
+      boolean duplicate = false;
+      for (CameraConfig existing : distinctResolutionConfigs) {
+        if (existing.getImageSize().equals(config.getImageSize())) {
+          duplicate = true;
+          break;
+        }
+      }
+      if (!duplicate) {
+        distinctResolutionConfigs.add(config);
+      }
+    }
+    return distinctResolutionConfigs;
   }
 
   private String getCameraIntrinsicsText(Frame frame) {
diff --git a/samples/computervision_java/gradle/wrapper/gradle-wrapper.jar b/samples/computervision_java/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/computervision_java/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/computervision_java/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/computervision_java/gradlew b/samples/computervision_java/gradlew
index 23d15a9..249efbb 100755
--- a/samples/computervision_java/gradlew
+++ b/samples/computervision_java/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/computervision_java/gradlew.bat b/samples/computervision_java/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/computervision_java/gradlew.bat
+++ b/samples/computervision_java/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/geospatial_java/app/build.gradle b/samples/geospatial_java/app/build.gradle
index c9b90a2..47e3b29 100644
--- a/samples/geospatial_java/app/build.gradle
+++ b/samples/geospatial_java/app/build.gradle
@@ -17,14 +17,14 @@
 
 android {
     namespace "com.google.ar.core.examples.java.geospatial"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.java.geospatial"
 
         // AR Optional apps must declare minSdkVersion >= 14.
         // AR Required apps must declare minSdkVersion >= 24.
         minSdkVersion 28
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
     }
@@ -42,7 +42,7 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
     implementation 'com.google.android.gms:play-services-location:19.0.1'
     implementation 'com.google.android.gms:play-services-auth:19.0.0'
 
diff --git a/samples/geospatial_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java b/samples/geospatial_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
index a8708ce..957446e 100644
--- a/samples/geospatial_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
+++ b/samples/geospatial_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
@@ -183,7 +183,9 @@
       ldCubemap =
           new Texture(render, Texture.Target.TEXTURE_CUBE_MAP, Texture.WrapMode.CLAMP_TO_EDGE);
 
-      ChunkIterable chunks = new ChunkIterable(getMaxColorAttachments());
+      // Limit to 1 color attachment per chunk pass to avoid Vulkan pipeline creation
+      // failures on GPUs that do not support multiple MRT half-float attachments (e.g. PowerVR).
+      ChunkIterable chunks = new ChunkIterable(min(getMaxColorAttachments(), 1));
       initializeLdCubemap();
       shaders = createShaders(render, chunks);
       framebuffers = createFramebuffers(chunks);
@@ -322,13 +324,13 @@
         GLES30.glTexImage2D(
             GLES30.GL_TEXTURE_CUBE_MAP_POSITIVE_X + face,
             level,
-            GLES30.GL_RGB16F,
-            /*width=*/ mipmapResolution,
-            /*height=*/ mipmapResolution,
-            /*border=*/ 0,
-            GLES30.GL_RGB,
+            GLES30.GL_RGBA16F,
+            /* width= */ mipmapResolution,
+            /* height= */ mipmapResolution,
+            /* border= */ 0,
+            GLES30.GL_RGBA,
             GLES30.GL_HALF_FLOAT,
-            /*data=*/ null);
+            /* data= */ null);
         GLError.maybeThrowGLException("Could not initialize LD cubemap mipmap", "glTexImage2D");
       }
     }
diff --git a/samples/geospatial_java/app/src/main/java/com/google/ar/core/examples/java/geospatial/GeospatialActivity.java b/samples/geospatial_java/app/src/main/java/com/google/ar/core/examples/java/geospatial/GeospatialActivity.java
index 5b7e809..c863f04 100644
--- a/samples/geospatial_java/app/src/main/java/com/google/ar/core/examples/java/geospatial/GeospatialActivity.java
+++ b/samples/geospatial_java/app/src/main/java/com/google/ar/core/examples/java/geospatial/GeospatialActivity.java
@@ -94,6 +94,7 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
@@ -405,7 +406,7 @@
     }
     // Check VPS availability before configure and resume session.
     if (session != null) {
-      getLastLocation();
+      getCurrentLocation();
     }
 
     // Note that order matters - see the note in onPause(), the reverse applies here.
@@ -443,23 +444,21 @@
     }
   }
 
-  private void getLastLocation() {
+  private void getCurrentLocation() {
     try {
       fusedLocationClient
-          .getLastLocation()
+          .getCurrentLocation(
+              com.google.android.gms.location.LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY,
+              /* cancellationToken= */ null)
           .addOnSuccessListener(
               new OnSuccessListener<Location>() {
                 @Override
                 public void onSuccess(Location location) {
-                  double latitude = 0;
-                  double longitude = 0;
                   if (location != null) {
-                    latitude = location.getLatitude();
-                    longitude = location.getLongitude();
+                    checkVpsAvailability(location.getLatitude(), location.getLongitude());
                   } else {
-                    Log.e(TAG, "Error location is null");
+                    Log.e(TAG, "Failed to get current location fix: location is null.");
                   }
-                  checkVpsAvailability(latitude, longitude);
                 }
               });
     } catch (SecurityException e) {
@@ -468,12 +467,24 @@
   }
 
   private void checkVpsAvailability(double latitude, double longitude) {
+    Log.i(
+        TAG,
+        String.format(
+            Locale.ROOT, "Checking VPS availability for lat/lng: %.6f, %.6f", latitude, longitude));
     final VpsAvailabilityFuture future =
         session.checkVpsAvailabilityAsync(
             latitude,
             longitude,
             availability -> {
               if (availability != VpsAvailability.AVAILABLE) {
+                Log.e(
+                    TAG,
+                    String.format(
+                        Locale.ROOT,
+                        "VPS is unavailable at lat/lng: %.6f, %.6f (status: %s)",
+                        latitude,
+                        longitude,
+                        availability));
                 showVpsNotAvailabilityNoticeDialog();
               }
             });
diff --git a/samples/geospatial_java/gradle/wrapper/gradle-wrapper.jar b/samples/geospatial_java/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/geospatial_java/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/geospatial_java/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/geospatial_java/gradlew b/samples/geospatial_java/gradlew
index 23d15a9..249efbb 100755
--- a/samples/geospatial_java/gradlew
+++ b/samples/geospatial_java/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/geospatial_java/gradlew.bat b/samples/geospatial_java/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/geospatial_java/gradlew.bat
+++ b/samples/geospatial_java/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/hardwarebuffer_c/app/build.gradle b/samples/hardwarebuffer_c/app/build.gradle
index dcc81aa..f07164c 100644
--- a/samples/hardwarebuffer_c/app/build.gradle
+++ b/samples/hardwarebuffer_c/app/build.gradle
@@ -26,14 +26,14 @@
 
 android {
     namespace "com.google.ar.core.examples.c.helloarhardwarebuffer"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.c.helloarhardwarebuffer"
 
         // "AR Optional" apps must declare minSdkVersion >= 14.
         // "AR Required" apps must declare minSdkVersion >= 27.
         minSdkVersion 27
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
 
@@ -71,8 +71,8 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
-    natives 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
+    natives 'com.google.ar:core:1.56.0'
 
     implementation 'androidx.appcompat:appcompat:1.1.0'
     implementation 'com.google.android.material:material:1.1.0'
diff --git a/samples/hardwarebuffer_c/gradle/wrapper/gradle-wrapper.jar b/samples/hardwarebuffer_c/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/hardwarebuffer_c/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/hardwarebuffer_c/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/hardwarebuffer_c/gradlew b/samples/hardwarebuffer_c/gradlew
index 23d15a9..249efbb 100755
--- a/samples/hardwarebuffer_c/gradlew
+++ b/samples/hardwarebuffer_c/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/hardwarebuffer_c/gradlew.bat b/samples/hardwarebuffer_c/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/hardwarebuffer_c/gradlew.bat
+++ b/samples/hardwarebuffer_c/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/hardwarebuffer_java/app/build.gradle b/samples/hardwarebuffer_java/app/build.gradle
index 64f7fb1..97f9d52 100644
--- a/samples/hardwarebuffer_java/app/build.gradle
+++ b/samples/hardwarebuffer_java/app/build.gradle
@@ -22,14 +22,14 @@
 
 android {
     namespace "com.google.ar.core.examples.java.helloarhardwarebuffer"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.java.helloarhardwarebuffer"
 
         // AR Optional apps must declare minSdkVersion >= 14.
         // AR Required apps must declare minSdkVersion >= 27.
         minSdkVersion 27
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
 
@@ -67,8 +67,8 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
-    natives 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
+    natives 'com.google.ar:core:1.56.0'
 
     // Obj - a simple Wavefront OBJ file loader
     // https://github.com/javagl/Obj
diff --git a/samples/hardwarebuffer_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java b/samples/hardwarebuffer_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
index a8708ce..957446e 100644
--- a/samples/hardwarebuffer_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
+++ b/samples/hardwarebuffer_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
@@ -183,7 +183,9 @@
       ldCubemap =
           new Texture(render, Texture.Target.TEXTURE_CUBE_MAP, Texture.WrapMode.CLAMP_TO_EDGE);
 
-      ChunkIterable chunks = new ChunkIterable(getMaxColorAttachments());
+      // Limit to 1 color attachment per chunk pass to avoid Vulkan pipeline creation
+      // failures on GPUs that do not support multiple MRT half-float attachments (e.g. PowerVR).
+      ChunkIterable chunks = new ChunkIterable(min(getMaxColorAttachments(), 1));
       initializeLdCubemap();
       shaders = createShaders(render, chunks);
       framebuffers = createFramebuffers(chunks);
@@ -322,13 +324,13 @@
         GLES30.glTexImage2D(
             GLES30.GL_TEXTURE_CUBE_MAP_POSITIVE_X + face,
             level,
-            GLES30.GL_RGB16F,
-            /*width=*/ mipmapResolution,
-            /*height=*/ mipmapResolution,
-            /*border=*/ 0,
-            GLES30.GL_RGB,
+            GLES30.GL_RGBA16F,
+            /* width= */ mipmapResolution,
+            /* height= */ mipmapResolution,
+            /* border= */ 0,
+            GLES30.GL_RGBA,
             GLES30.GL_HALF_FLOAT,
-            /*data=*/ null);
+            /* data= */ null);
         GLError.maybeThrowGLException("Could not initialize LD cubemap mipmap", "glTexImage2D");
       }
     }
diff --git a/samples/hardwarebuffer_java/gradle/wrapper/gradle-wrapper.jar b/samples/hardwarebuffer_java/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/hardwarebuffer_java/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/hardwarebuffer_java/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/hardwarebuffer_java/gradlew b/samples/hardwarebuffer_java/gradlew
index 23d15a9..249efbb 100755
--- a/samples/hardwarebuffer_java/gradlew
+++ b/samples/hardwarebuffer_java/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/hardwarebuffer_java/gradlew.bat b/samples/hardwarebuffer_java/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/hardwarebuffer_java/gradlew.bat
+++ b/samples/hardwarebuffer_java/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/hello_ar_c/app/build.gradle b/samples/hello_ar_c/app/build.gradle
index 054eedc..8f6afe0 100644
--- a/samples/hello_ar_c/app/build.gradle
+++ b/samples/hello_ar_c/app/build.gradle
@@ -26,14 +26,14 @@
 
 android {
     namespace "com.google.ar.core.examples.c.helloar"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.c.helloar"
 
         // "AR Optional" apps must declare minSdkVersion >= 14.
         // "AR Required" apps must declare minSdkVersion >= 24.
         minSdkVersion 24
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
 
@@ -69,8 +69,8 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
-    natives 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
+    natives 'com.google.ar:core:1.56.0'
 
     implementation 'androidx.appcompat:appcompat:1.1.0'
     implementation 'com.google.android.material:material:1.1.0'
diff --git a/samples/hello_ar_c/gradle/wrapper/gradle-wrapper.jar b/samples/hello_ar_c/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/hello_ar_c/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/hello_ar_c/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/hello_ar_c/gradlew b/samples/hello_ar_c/gradlew
index 23d15a9..249efbb 100755
--- a/samples/hello_ar_c/gradlew
+++ b/samples/hello_ar_c/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/hello_ar_c/gradlew.bat b/samples/hello_ar_c/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/hello_ar_c/gradlew.bat
+++ b/samples/hello_ar_c/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/hello_ar_java/app/build.gradle b/samples/hello_ar_java/app/build.gradle
index 3cb0048..c0a283b 100644
--- a/samples/hello_ar_java/app/build.gradle
+++ b/samples/hello_ar_java/app/build.gradle
@@ -17,14 +17,14 @@
 
 android {
     namespace "com.google.ar.core.examples.java.helloar"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.java.helloar"
 
         // AR Optional apps must declare minSdkVersion >= 14.
         // AR Required apps must declare minSdkVersion >= 24.
         minSdkVersion 24
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
     }
@@ -42,7 +42,7 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
 
     // Obj - a simple Wavefront OBJ file loader
     // https://github.com/javagl/Obj
diff --git a/samples/hello_ar_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java b/samples/hello_ar_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
index a8708ce..957446e 100644
--- a/samples/hello_ar_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
+++ b/samples/hello_ar_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
@@ -183,7 +183,9 @@
       ldCubemap =
           new Texture(render, Texture.Target.TEXTURE_CUBE_MAP, Texture.WrapMode.CLAMP_TO_EDGE);
 
-      ChunkIterable chunks = new ChunkIterable(getMaxColorAttachments());
+      // Limit to 1 color attachment per chunk pass to avoid Vulkan pipeline creation
+      // failures on GPUs that do not support multiple MRT half-float attachments (e.g. PowerVR).
+      ChunkIterable chunks = new ChunkIterable(min(getMaxColorAttachments(), 1));
       initializeLdCubemap();
       shaders = createShaders(render, chunks);
       framebuffers = createFramebuffers(chunks);
@@ -322,13 +324,13 @@
         GLES30.glTexImage2D(
             GLES30.GL_TEXTURE_CUBE_MAP_POSITIVE_X + face,
             level,
-            GLES30.GL_RGB16F,
-            /*width=*/ mipmapResolution,
-            /*height=*/ mipmapResolution,
-            /*border=*/ 0,
-            GLES30.GL_RGB,
+            GLES30.GL_RGBA16F,
+            /* width= */ mipmapResolution,
+            /* height= */ mipmapResolution,
+            /* border= */ 0,
+            GLES30.GL_RGBA,
             GLES30.GL_HALF_FLOAT,
-            /*data=*/ null);
+            /* data= */ null);
         GLError.maybeThrowGLException("Could not initialize LD cubemap mipmap", "glTexImage2D");
       }
     }
diff --git a/samples/hello_ar_java/gradle/wrapper/gradle-wrapper.jar b/samples/hello_ar_java/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/hello_ar_java/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/hello_ar_java/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/hello_ar_java/gradlew b/samples/hello_ar_java/gradlew
index 23d15a9..249efbb 100755
--- a/samples/hello_ar_java/gradlew
+++ b/samples/hello_ar_java/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/hello_ar_java/gradlew.bat b/samples/hello_ar_java/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/hello_ar_java/gradlew.bat
+++ b/samples/hello_ar_java/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/hello_ar_kotlin/app/build.gradle b/samples/hello_ar_kotlin/app/build.gradle
index 1f45b03..4cffabf 100644
--- a/samples/hello_ar_kotlin/app/build.gradle
+++ b/samples/hello_ar_kotlin/app/build.gradle
@@ -18,14 +18,14 @@
 
 android {
     namespace "com.google.ar.core.examples.kotlin.helloar"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.kotlin.helloar"
 
         // AR Optional apps must declare minSdkVersion >= 14.
         // AR Required apps must declare minSdkVersion >= 24.
         minSdkVersion 24
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
     }
@@ -46,7 +46,7 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
 
     // Obj - a simple Wavefront OBJ file loader
     // https://github.com/javagl/Obj
diff --git a/samples/hello_ar_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java b/samples/hello_ar_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
index a8708ce..957446e 100644
--- a/samples/hello_ar_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
+++ b/samples/hello_ar_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
@@ -183,7 +183,9 @@
       ldCubemap =
           new Texture(render, Texture.Target.TEXTURE_CUBE_MAP, Texture.WrapMode.CLAMP_TO_EDGE);
 
-      ChunkIterable chunks = new ChunkIterable(getMaxColorAttachments());
+      // Limit to 1 color attachment per chunk pass to avoid Vulkan pipeline creation
+      // failures on GPUs that do not support multiple MRT half-float attachments (e.g. PowerVR).
+      ChunkIterable chunks = new ChunkIterable(min(getMaxColorAttachments(), 1));
       initializeLdCubemap();
       shaders = createShaders(render, chunks);
       framebuffers = createFramebuffers(chunks);
@@ -322,13 +324,13 @@
         GLES30.glTexImage2D(
             GLES30.GL_TEXTURE_CUBE_MAP_POSITIVE_X + face,
             level,
-            GLES30.GL_RGB16F,
-            /*width=*/ mipmapResolution,
-            /*height=*/ mipmapResolution,
-            /*border=*/ 0,
-            GLES30.GL_RGB,
+            GLES30.GL_RGBA16F,
+            /* width= */ mipmapResolution,
+            /* height= */ mipmapResolution,
+            /* border= */ 0,
+            GLES30.GL_RGBA,
             GLES30.GL_HALF_FLOAT,
-            /*data=*/ null);
+            /* data= */ null);
         GLError.maybeThrowGLException("Could not initialize LD cubemap mipmap", "glTexImage2D");
       }
     }
diff --git a/samples/hello_ar_kotlin/gradle/wrapper/gradle-wrapper.jar b/samples/hello_ar_kotlin/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/hello_ar_kotlin/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/hello_ar_kotlin/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/hello_ar_kotlin/gradlew b/samples/hello_ar_kotlin/gradlew
index 23d15a9..249efbb 100755
--- a/samples/hello_ar_kotlin/gradlew
+++ b/samples/hello_ar_kotlin/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/hello_ar_kotlin/gradlew.bat b/samples/hello_ar_kotlin/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/hello_ar_kotlin/gradlew.bat
+++ b/samples/hello_ar_kotlin/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/hello_ar_vulkan_c/app/build.gradle b/samples/hello_ar_vulkan_c/app/build.gradle
index 1f817af..9405cf8 100644
--- a/samples/hello_ar_vulkan_c/app/build.gradle
+++ b/samples/hello_ar_vulkan_c/app/build.gradle
@@ -26,14 +26,14 @@
 
 android {
     namespace "com.google.ar.core.examples.c.helloarvulkan"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.c.helloarvulkan"
 
         // "AR Optional" apps must declare minSdkVersion >= 14.
         // "AR Required" apps must declare minSdkVersion >= 28.
         minSdkVersion 28
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
 
@@ -70,8 +70,8 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
-    natives 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
+    natives 'com.google.ar:core:1.56.0'
 
     implementation 'androidx.appcompat:appcompat:1.1.0'
     implementation 'com.google.android.material:material:1.1.0'
diff --git a/samples/hello_ar_vulkan_c/gradle/wrapper/gradle-wrapper.jar b/samples/hello_ar_vulkan_c/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/hello_ar_vulkan_c/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/hello_ar_vulkan_c/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/hello_ar_vulkan_c/gradlew b/samples/hello_ar_vulkan_c/gradlew
index 23d15a9..249efbb 100755
--- a/samples/hello_ar_vulkan_c/gradlew
+++ b/samples/hello_ar_vulkan_c/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/hello_ar_vulkan_c/gradlew.bat b/samples/hello_ar_vulkan_c/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/hello_ar_vulkan_c/gradlew.bat
+++ b/samples/hello_ar_vulkan_c/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/hello_eis_kotlin/app/build.gradle b/samples/hello_eis_kotlin/app/build.gradle
index 928f69d..5fe2da8 100644
--- a/samples/hello_eis_kotlin/app/build.gradle
+++ b/samples/hello_eis_kotlin/app/build.gradle
@@ -18,14 +18,14 @@
 
 android {
     namespace "com.google.ar.core.examples.kotlin.helloeis"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.kotlin.helloeis"
 
         // AR Optional apps must declare minSdkVersion >= 14.
         // AR Required apps must declare minSdkVersion >= 24.
         minSdkVersion 24
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
     }
@@ -46,7 +46,7 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
 
     // Obj - a simple Wavefront OBJ file loader
     // https://github.com/javagl/Obj
diff --git a/samples/hello_eis_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java b/samples/hello_eis_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
index a8708ce..957446e 100644
--- a/samples/hello_eis_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
+++ b/samples/hello_eis_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
@@ -183,7 +183,9 @@
       ldCubemap =
           new Texture(render, Texture.Target.TEXTURE_CUBE_MAP, Texture.WrapMode.CLAMP_TO_EDGE);
 
-      ChunkIterable chunks = new ChunkIterable(getMaxColorAttachments());
+      // Limit to 1 color attachment per chunk pass to avoid Vulkan pipeline creation
+      // failures on GPUs that do not support multiple MRT half-float attachments (e.g. PowerVR).
+      ChunkIterable chunks = new ChunkIterable(min(getMaxColorAttachments(), 1));
       initializeLdCubemap();
       shaders = createShaders(render, chunks);
       framebuffers = createFramebuffers(chunks);
@@ -322,13 +324,13 @@
         GLES30.glTexImage2D(
             GLES30.GL_TEXTURE_CUBE_MAP_POSITIVE_X + face,
             level,
-            GLES30.GL_RGB16F,
-            /*width=*/ mipmapResolution,
-            /*height=*/ mipmapResolution,
-            /*border=*/ 0,
-            GLES30.GL_RGB,
+            GLES30.GL_RGBA16F,
+            /* width= */ mipmapResolution,
+            /* height= */ mipmapResolution,
+            /* border= */ 0,
+            GLES30.GL_RGBA,
             GLES30.GL_HALF_FLOAT,
-            /*data=*/ null);
+            /* data= */ null);
         GLError.maybeThrowGLException("Could not initialize LD cubemap mipmap", "glTexImage2D");
       }
     }
diff --git a/samples/hello_eis_kotlin/gradle/wrapper/gradle-wrapper.jar b/samples/hello_eis_kotlin/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/hello_eis_kotlin/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/hello_eis_kotlin/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/hello_eis_kotlin/gradlew b/samples/hello_eis_kotlin/gradlew
index 23d15a9..249efbb 100755
--- a/samples/hello_eis_kotlin/gradlew
+++ b/samples/hello_eis_kotlin/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/hello_eis_kotlin/gradlew.bat b/samples/hello_eis_kotlin/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/hello_eis_kotlin/gradlew.bat
+++ b/samples/hello_eis_kotlin/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/ml_kotlin/app/build.gradle b/samples/ml_kotlin/app/build.gradle
index cfcc940..4e99719 100644
--- a/samples/ml_kotlin/app/build.gradle
+++ b/samples/ml_kotlin/app/build.gradle
@@ -20,12 +20,12 @@
 
 android {
     namespace "com.google.ar.core.examples.kotlin.ml"
-    compileSdkVersion 36
+    compileSdkVersion 37
 
     defaultConfig {
         applicationId "com.google.ar.core.examples.kotlin.ml"
         minSdkVersion 24
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
     }
@@ -70,7 +70,7 @@
     implementation 'com.google.mlkit:object-detection-custom:16.3.1'
 
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
 
     // Obj - a simple Wavefront OBJ file loader
     // https://github.com/javagl/Obj
diff --git a/samples/ml_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java b/samples/ml_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
index a8708ce..957446e 100644
--- a/samples/ml_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
+++ b/samples/ml_kotlin/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
@@ -183,7 +183,9 @@
       ldCubemap =
           new Texture(render, Texture.Target.TEXTURE_CUBE_MAP, Texture.WrapMode.CLAMP_TO_EDGE);
 
-      ChunkIterable chunks = new ChunkIterable(getMaxColorAttachments());
+      // Limit to 1 color attachment per chunk pass to avoid Vulkan pipeline creation
+      // failures on GPUs that do not support multiple MRT half-float attachments (e.g. PowerVR).
+      ChunkIterable chunks = new ChunkIterable(min(getMaxColorAttachments(), 1));
       initializeLdCubemap();
       shaders = createShaders(render, chunks);
       framebuffers = createFramebuffers(chunks);
@@ -322,13 +324,13 @@
         GLES30.glTexImage2D(
             GLES30.GL_TEXTURE_CUBE_MAP_POSITIVE_X + face,
             level,
-            GLES30.GL_RGB16F,
-            /*width=*/ mipmapResolution,
-            /*height=*/ mipmapResolution,
-            /*border=*/ 0,
-            GLES30.GL_RGB,
+            GLES30.GL_RGBA16F,
+            /* width= */ mipmapResolution,
+            /* height= */ mipmapResolution,
+            /* border= */ 0,
+            GLES30.GL_RGBA,
             GLES30.GL_HALF_FLOAT,
-            /*data=*/ null);
+            /* data= */ null);
         GLError.maybeThrowGLException("Could not initialize LD cubemap mipmap", "glTexImage2D");
       }
     }
diff --git a/samples/ml_kotlin/gradle/wrapper/gradle-wrapper.jar b/samples/ml_kotlin/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/ml_kotlin/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/ml_kotlin/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/ml_kotlin/gradlew b/samples/ml_kotlin/gradlew
index 23d15a9..249efbb 100755
--- a/samples/ml_kotlin/gradlew
+++ b/samples/ml_kotlin/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/ml_kotlin/gradlew.bat b/samples/ml_kotlin/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/ml_kotlin/gradlew.bat
+++ b/samples/ml_kotlin/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/persistent_cloud_anchor_java/app/build.gradle b/samples/persistent_cloud_anchor_java/app/build.gradle
index 8589de8..3bcd440 100644
--- a/samples/persistent_cloud_anchor_java/app/build.gradle
+++ b/samples/persistent_cloud_anchor_java/app/build.gradle
@@ -17,14 +17,14 @@
 
 android {
     namespace "com.google.ar.core.examples.java.persistentcloudanchor"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.java.persistentcloudanchor"
 
         // "AR Optional" apps must declare minSdkVersion >= 14.
         // "AR Required" apps must declare minSdkVersion >= 24.
         minSdkVersion 24
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
     }
@@ -46,7 +46,7 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
 
     // Obj - a simple Wavefront OBJ file loader
     // https://github.com/javagl/Obj
diff --git a/samples/persistent_cloud_anchor_java/gradle/wrapper/gradle-wrapper.jar b/samples/persistent_cloud_anchor_java/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/persistent_cloud_anchor_java/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/persistent_cloud_anchor_java/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/persistent_cloud_anchor_java/gradlew b/samples/persistent_cloud_anchor_java/gradlew
index 23d15a9..249efbb 100755
--- a/samples/persistent_cloud_anchor_java/gradlew
+++ b/samples/persistent_cloud_anchor_java/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/persistent_cloud_anchor_java/gradlew.bat b/samples/persistent_cloud_anchor_java/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/persistent_cloud_anchor_java/gradlew.bat
+++ b/samples/persistent_cloud_anchor_java/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/raw_depth_java/app/build.gradle b/samples/raw_depth_java/app/build.gradle
index 1a44562..039e2ac 100644
--- a/samples/raw_depth_java/app/build.gradle
+++ b/samples/raw_depth_java/app/build.gradle
@@ -17,15 +17,15 @@
 
 android {
     namespace "com.google.ar.core.examples.java.rawdepth"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.java.rawdepth"
 
         // Camera2 API requires minSdkVersion >= 23
         // "AR Optional" apps must declare minSdkVersion >= 14.
         // "AR Required" apps must declare minSdkVersion >= 24.
-        minSdkVersion 23
-        targetSdkVersion 36
+        minSdkVersion 24
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
     }
@@ -43,7 +43,7 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
 
     // Obj - a simple Wavefront OBJ file loader
     // https://github.com/javagl/Obj
diff --git a/samples/raw_depth_java/gradle/wrapper/gradle-wrapper.jar b/samples/raw_depth_java/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/raw_depth_java/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/raw_depth_java/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/raw_depth_java/gradlew b/samples/raw_depth_java/gradlew
index 23d15a9..249efbb 100755
--- a/samples/raw_depth_java/gradlew
+++ b/samples/raw_depth_java/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/raw_depth_java/gradlew.bat b/samples/raw_depth_java/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/raw_depth_java/gradlew.bat
+++ b/samples/raw_depth_java/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/recording_playback_java/app/build.gradle b/samples/recording_playback_java/app/build.gradle
index 963ebf7..efc6dbb 100644
--- a/samples/recording_playback_java/app/build.gradle
+++ b/samples/recording_playback_java/app/build.gradle
@@ -17,14 +17,14 @@
 
 android {
     namespace "com.google.ar.core.examples.java.hellorecordingplayback"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.java.hellorecordingplayback"
 
         // AR Optional apps must declare minSdkVersion >= 14.
         // AR Required apps must declare minSdkVersion >= 24.
         minSdkVersion 24
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
     }
@@ -42,7 +42,7 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
 
     // Obj - a simple Wavefront OBJ file loader
     // https://github.com/javagl/Obj
diff --git a/samples/recording_playback_java/app/src/main/java/com/google/ar/core/examples/java/hellorecordingplayback/HelloRecordingPlaybackActivity.java b/samples/recording_playback_java/app/src/main/java/com/google/ar/core/examples/java/hellorecordingplayback/HelloRecordingPlaybackActivity.java
index 73aa67f..0d95af5 100644
--- a/samples/recording_playback_java/app/src/main/java/com/google/ar/core/examples/java/hellorecordingplayback/HelloRecordingPlaybackActivity.java
+++ b/samples/recording_playback_java/app/src/main/java/com/google/ar/core/examples/java/hellorecordingplayback/HelloRecordingPlaybackActivity.java
@@ -302,6 +302,20 @@
   }
 
   @Override
+  protected void onDestroy() {
+    if (session != null) {
+      // Explicitly close ARCore Session to release native resources.
+      // Review the API reference for important considerations before calling close() in apps with
+      // more complicated lifecycle requirements:
+      // https://developers.google.com/ar/reference/java/arcore/reference/com/google/ar/core/Session#close()
+      session.close();
+      session = null;
+    }
+
+    super.onDestroy();
+  }
+
+  @Override
   public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] results) {
     super.onRequestPermissionsResult(requestCode, permissions, results);
     if (requestCode == PERMISSIONS_REQUEST_CODE) {
diff --git a/samples/recording_playback_java/gradle/wrapper/gradle-wrapper.jar b/samples/recording_playback_java/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/recording_playback_java/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/recording_playback_java/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/recording_playback_java/gradlew b/samples/recording_playback_java/gradlew
index 23d15a9..249efbb 100755
--- a/samples/recording_playback_java/gradlew
+++ b/samples/recording_playback_java/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/recording_playback_java/gradlew.bat b/samples/recording_playback_java/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/recording_playback_java/gradlew.bat
+++ b/samples/recording_playback_java/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/semantics_java/app/build.gradle b/samples/semantics_java/app/build.gradle
index 5265ed0..24b312f 100644
--- a/samples/semantics_java/app/build.gradle
+++ b/samples/semantics_java/app/build.gradle
@@ -17,14 +17,14 @@
 
 android {
     namespace "com.google.ar.core.examples.java.hellosemantics"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.java.hellosemantics"
 
         // AR Optional apps must declare minSdkVersion >= 14.
         // AR Required apps must declare minSdkVersion >= 24.
         minSdkVersion 24
-        targetSdkVersion 36
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
     }
@@ -42,7 +42,7 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
 
     // Obj - a simple Wavefront OBJ file loader
     // https://github.com/javagl/Obj
diff --git a/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java b/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
index a8708ce..957446e 100644
--- a/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
+++ b/samples/semantics_java/app/src/main/java/com/google/ar/core/examples/java/common/samplerender/arcore/SpecularCubemapFilter.java
@@ -183,7 +183,9 @@
       ldCubemap =
           new Texture(render, Texture.Target.TEXTURE_CUBE_MAP, Texture.WrapMode.CLAMP_TO_EDGE);
 
-      ChunkIterable chunks = new ChunkIterable(getMaxColorAttachments());
+      // Limit to 1 color attachment per chunk pass to avoid Vulkan pipeline creation
+      // failures on GPUs that do not support multiple MRT half-float attachments (e.g. PowerVR).
+      ChunkIterable chunks = new ChunkIterable(min(getMaxColorAttachments(), 1));
       initializeLdCubemap();
       shaders = createShaders(render, chunks);
       framebuffers = createFramebuffers(chunks);
@@ -322,13 +324,13 @@
         GLES30.glTexImage2D(
             GLES30.GL_TEXTURE_CUBE_MAP_POSITIVE_X + face,
             level,
-            GLES30.GL_RGB16F,
-            /*width=*/ mipmapResolution,
-            /*height=*/ mipmapResolution,
-            /*border=*/ 0,
-            GLES30.GL_RGB,
+            GLES30.GL_RGBA16F,
+            /* width= */ mipmapResolution,
+            /* height= */ mipmapResolution,
+            /* border= */ 0,
+            GLES30.GL_RGBA,
             GLES30.GL_HALF_FLOAT,
-            /*data=*/ null);
+            /* data= */ null);
         GLError.maybeThrowGLException("Could not initialize LD cubemap mipmap", "glTexImage2D");
       }
     }
diff --git a/samples/semantics_java/gradle/wrapper/gradle-wrapper.jar b/samples/semantics_java/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/semantics_java/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/semantics_java/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/semantics_java/gradlew b/samples/semantics_java/gradlew
index 23d15a9..249efbb 100755
--- a/samples/semantics_java/gradlew
+++ b/samples/semantics_java/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/semantics_java/gradlew.bat b/samples/semantics_java/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/semantics_java/gradlew.bat
+++ b/samples/semantics_java/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%

diff --git a/samples/shared_camera_java/app/build.gradle b/samples/shared_camera_java/app/build.gradle
index 94201a8..87597cb 100644
--- a/samples/shared_camera_java/app/build.gradle
+++ b/samples/shared_camera_java/app/build.gradle
@@ -17,15 +17,15 @@
 
 android {
     namespace "com.google.ar.core.examples.java.sharedcamera"
-    compileSdkVersion 36
+    compileSdkVersion 37
     defaultConfig {
         applicationId "com.google.ar.core.examples.java.sharedcamera"
 
         // Camera2 API requires minSdkVersion >= 23
         // "AR Optional" apps must declare minSdkVersion >= 14.
         // "AR Required" apps must declare minSdkVersion >= 24.
-        minSdkVersion 23
-        targetSdkVersion 36
+        minSdkVersion 24
+        targetSdkVersion 37
         versionCode 1
         versionName '1.0'
     }
@@ -43,7 +43,7 @@
 
 dependencies {
     // ARCore (Google Play Services for AR) library.
-    implementation 'com.google.ar:core:1.54.0'
+    implementation 'com.google.ar:core:1.56.0'
 
     // Obj - a simple Wavefront OBJ file loader
     // https://github.com/javagl/Obj
diff --git a/samples/shared_camera_java/gradle/wrapper/gradle-wrapper.jar b/samples/shared_camera_java/gradle/wrapper/gradle-wrapper.jar
index 1b33c55..b1b8ef5 100644
--- a/samples/shared_camera_java/gradle/wrapper/gradle-wrapper.jar
+++ b/samples/shared_camera_java/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/samples/shared_camera_java/gradlew b/samples/shared_camera_java/gradlew
index 23d15a9..249efbb 100755
--- a/samples/shared_camera_java/gradlew
+++ b/samples/shared_camera_java/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 
 ##############################################################################
 #
-#   Gradle start up script for POSIX generated by Gradle.
+#   gradlew start up script for POSIX generated by Gradle.
 #
 #   Important for running:
 #
@@ -29,7 +29,7 @@
 #       bash, then to run this script, type that shell name before the whole
 #       command line, like:
 #
-#           ksh Gradle
+#           ksh gradlew
 #
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
 #       Darwin, MinGW, and NonStop.
 #
 #   (3) This script is generated from the Groovy template
-#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
 #       within the Gradle project.
 #
 #       You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@
   NONSTOP* )        nonstop=true ;;
 esac
 
-CLASSPATH="\\\"\\\""
 
 
 # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@
 # For Cygwin or MSYS, switch paths to Windows format before running java
 if "$cygwin" || "$msys" ; then
     APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
-    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
 
     JAVACMD=$( cygpath --unix "$JAVACMD" )
 
@@ -212,7 +210,6 @@
 
 set -- \
         "-Dorg.gradle.appname=$APP_BASE_NAME" \
-        -classpath "$CLASSPATH" \
         -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
         "$@"
 
diff --git a/samples/shared_camera_java/gradlew.bat b/samples/shared_camera_java/gradlew.bat
index 5eed7ee..8508ef6 100644
--- a/samples/shared_camera_java/gradlew.bat
+++ b/samples/shared_camera_java/gradlew.bat
@@ -19,12 +19,12 @@
 @if "%DEBUG%"=="" @echo off

 @rem ##########################################################################

 @rem

-@rem  Gradle startup script for Windows

+@rem  gradlew startup script for Windows

 @rem

 @rem ##########################################################################

 

-@rem Set local scope for the variables with windows NT shell

-if "%OS%"=="Windows_NT" setlocal

+@rem Set local scope for the variables, and ensure extensions are enabled

+setlocal EnableExtensions

 

 set DIRNAME=%~dp0

 if "%DIRNAME%"=="" set DIRNAME=.

@@ -51,7 +51,7 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :findJavaFromJavaHome

 set JAVA_HOME=%JAVA_HOME:"=%

@@ -65,30 +65,18 @@
 echo Please set the JAVA_HOME variable in your environment to match the 1>&2

 echo location of your Java installation. 1>&2

 

-goto fail

+"%COMSPEC%" /c exit 1

 

 :execute

 @rem Setup the command line

 

-set CLASSPATH=

 

 

-@rem Execute Gradle

-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

+@rem Execute gradlew

+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded

+@rem which allows us to clear the local environment before executing the java command

+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel

 

-:end

-@rem End local scope for the variables with windows NT shell

-if %ERRORLEVEL% equ 0 goto mainEnd

-

-:fail

-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

-rem the _cmd.exe /c_ return code!

-set EXIT_CODE=%ERRORLEVEL%

-if %EXIT_CODE% equ 0 set EXIT_CODE=1

-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%

-exit /b %EXIT_CODE%

-

-:mainEnd

-if "%OS%"=="Windows_NT" endlocal

-

-:omega

+:exitWithErrorLevel

+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts

+"%COMSPEC%" /c exit %ERRORLEVEL%