diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index c72e0c73eb5e..0621ec26feb8 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1386,6 +1386,26 @@ CameraMetadata *CameraDevice::requestTemplatePreview()
 		return nullptr;
 	}
 
+	/* Get the FPS range registered in the static metadata. */
+	camera_metadata_ro_entry_t entry;
+	bool found = staticMetadata_->getEntry(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,
+					       &entry);
+	if (!found) {
+		LOG(HAL, Error) << "Cannot create capture template without FPS range";
+		return nullptr;
+	}
+
+	/*
+	 * \todo Depending on the requested CaptureIntent, the FPS range
+	 * needs to be adjusted. For example, the capture template for
+	 * video capture intent shall report a fixed value.
+	 *
+	 * Also assume the AE_AVAILABLE_TARGET_FPS_RANGE static metadata
+	 * has been assembled as {{min, max} {max, max}}.
+	 */
+	requestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,
+				  entry.data.i32, 2);
+
 	uint8_t aeMode = ANDROID_CONTROL_AE_MODE_ON;
 	requestTemplate->addEntry(ANDROID_CONTROL_AE_MODE,
 				  &aeMode, 1);
@@ -1402,22 +1422,6 @@ CameraMetadata *CameraDevice::requestTemplatePreview()
 	requestTemplate->addEntry(ANDROID_CONTROL_AE_LOCK,
 				  &aeLock, 1);
 
-	/* Get the FPS range registered in the static metadata. */
-	camera_metadata_ro_entry_t entry;
-	bool found = staticMetadata_->getEntry(ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES,
-					       &entry);
-	if (found)
-		/*
-		 * \todo Depending on the requested CaptureIntent, the FPS range
-		 * needs to be adjusted. For example, the capture template for
-		 * video capture intent shall report a fixed value.
-		 *
-		 * Also assume the AE_AVAILABLE_TARGET_FPS_RANGE static metadata
-		 * has been assembled as {{min, max} {max, max}}.
-		 */
-		requestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,
-					  entry.data.i32, 2);
-
 	uint8_t aeAntibandingMode = ANDROID_CONTROL_AE_ANTIBANDING_MODE_AUTO;
 	requestTemplate->addEntry(ANDROID_CONTROL_AE_ANTIBANDING_MODE,
 				  &aeAntibandingMode, 1);
