Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/camera/camera_android_camerax/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 0.7.4+5

* Adds explicit `androidx.concurrent:concurrent-futures:1.2.0` dependency to fix
`compileDebugJavaWithJavac` failing with "class file for
androidx.concurrent.futures.CallbackToFutureAdapter not found" when
`camera-core`'s jspecify type annotations are resolved during compilation.

## 0.7.4+4

* Fix `NullPointerException` when disposing camera during active video recording.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ dependencies {
implementation("androidx.camera:camera-lifecycle:${cameraxVersion}")
implementation("androidx.camera:camera-video:${cameraxVersion}")
implementation("com.google.guava:guava:33.5.0-android")
// camera-core's compiled classes reference CallbackToFutureAdapter type annotations;
// without this explicit dependency, javac fails to resolve them during compilation.
implementation("androidx.concurrent:concurrent-futures:1.2.0")
testImplementation("junit:junit:4.13.2")
testImplementation("org.mockito:mockito-core:5.23.0")
testImplementation("org.mockito:mockito-inline:5.2.0")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2013 The Flutter Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.plugins.camerax;

import static org.junit.Assert.assertNotNull;

import androidx.concurrent.futures.CallbackToFutureAdapter;
import org.junit.Test;

/**
* Regression test for https://github.com/flutter/flutter/issues/190505.
*
* <p>{@code camera-core}'s compiled classes carry jspecify {@code @NonNull} type annotations on
* members that reference {@link CallbackToFutureAdapter}. javac needs that class on the compile
* classpath to process those annotations, even though this plugin never calls the annotated
* members directly. Without an explicit {@code androidx.concurrent:concurrent-futures} dependency,
* resolution of that class can silently depend on transitive dependency behavior and fail with
* "class file for androidx.concurrent.futures.CallbackToFutureAdapter not found" during {@code
* compileDebugJavaWithJavac}.
*
* <p>The static reference to {@link CallbackToFutureAdapter} below means that if the explicit
* dependency in {@code android/build.gradle.kts} is ever removed, this test target fails to
* compile instead of the break only surfacing as a build error for consumers.
*/
public class ConcurrentFuturesDependencyTest {
@Test
public void callbackToFutureAdapter_isOnClasspath() {
assertNotNull(CallbackToFutureAdapter.class);
}
}
2 changes: 1 addition & 1 deletion packages/camera/camera_android_camerax/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: camera_android_camerax
description: Android implementation of the camera plugin using the CameraX library.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.7.4+4
version: 0.7.4+5

environment:
sdk: ^3.12.0
Expand Down