diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 9605b9e9069e..ad0d7fd15d90 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -392,10 +392,16 @@ int CameraDevice::initializeStreamConfigurations()
 				break;
 			}
 		}
-		if (camera3Format.mandatory && !mappedFormat.isValid()) {
-			LOG(HAL, Error) << "Failed to map Android format "
-					<< camera3Format.name << " ("
-					<< utils::hex(androidFormat) << ")";
+
+		if (!mappedFormat.isValid()) {
+			/* If the format is not mandatory, skip it. */
+			if (!camera3Format.mandatory)
+				continue;
+
+			LOG(HAL, Error)
+				<< "Failed to map mandatory Android format "
+				<< camera3Format.name << " ("
+				<< utils::hex(androidFormat) << "): aborting";
 			return -EINVAL;
 		}
 
