Repository navigation
[camera_android_camerax] Add explicit concurrent-futures dependency - #12373
auto-submit[bot] merged 16 commits into
Conversation
camera-core's compiled classes carry jspecify @nonnull type annotations on members that reference androidx.concurrent.futures.CallbackToFutureAdapter. Since camera_android_camerax never declared that dependency directly, it compiled fine as long as it was pulled in transitively — but under recent AGP/Gradle resolution behavior it may not be, causing: error: Cannot attach type annotations @org.jspecify.annotations.NonNull to SurfaceRequest.mSurfaceRecreationCompleter: class file for androidx.concurrent.futures.CallbackToFutureAdapter not found Declaring the dependency explicitly fixes compileDebugJavaWithJavac.
Referencing CallbackToFutureAdapter.class directly means the test target fails to compile (rather than a runtime ClassNotFoundException) if the concurrent-futures dependency is ever removed, which is a stronger and more immediate signal.
There was a problem hiding this comment.
Code Review
This pull request adds an explicit dependency on androidx.concurrent:concurrent-futures:1.2.0 in build.gradle.kts to resolve compilation issues with CallbackToFutureAdapter annotations in camera-core. It also introduces a regression test, ConcurrentFuturesDependencyTest, to ensure the class remains on the classpath, and updates the package version and changelog accordingly. There are no review comments, and I have no feedback to provide.
In the future please do not re-file a PR just because you have received and addressed review feedback. Review comments and discussion are an important part of a commit's history.
Please don't include irrelevant local AI output in your PR descriptions. |
|
Sorry about both of those — you're right on each count:
On why this is needed: This reproduces 100% on a completely stock @saurabh-mirajkar independently reproduced this on latest stable + Android Studio Quail and reopened flutter/flutter#190505 based on it, so this isn't environment-specific noise. I know a very similar PR (#10906) was submitted back in January and closed for inactivity after the same question was raised — I have the repro and root-cause evidence that PR didn't, so happy to answer anything else needed to get this reviewable. |
|
I'm not sure why you've re-posted the PR description's explanation as a comment; I read the PR description. I've also read the issue, as evidenced by the fact that I commented on the issue. Please respond to the question I asked and the review feedback I left, rather than restating things that have already been explained, and which do not address my comment. |
There was a problem hiding this comment.
Hi @stuartmorgan-g , I encountered this compilation error locally while running a standard Flutter app and traced the root cause down to the camera-core package's Gradle metadata. Since I just focused on fixing the build break I was facing, I haven't filed an official upstream issue with the AndroidX/Jetpack team yet.
Would you like me to file a new bug on the Google Issue Tracker and link it here, or is there a standard way the Flutter team prefers to track these upstream AndroidX problems?
|
@dhc-tech Whatever AI tool you are using to post comments, please either fix it to stop spamming PRs, or stop using it. Your last comment was posted and deleted 4 times in two minutes, causing four separate email notifications to the team members subscribed to this issue. (And please do not post AI-generated sycophantic responses telling me that I'm right to point that out, just fix the issue.)
The link to the upstream issue should be included in the code comment where I left the review note about it. |
|
Hi @stuartmorgan-g,
Let's get one thing straight: I am **NOT** using any AI tool, bot, or
automated script. I posted my comments manually. The duplication was a
simple manual error on my end while trying to fix a misclick, which
unfortunately caused the multiple notifications. Jumping to conclusions and
accusing a contributor of "AI spamming" is completely uncalled for and
frustrating.
I have already applied this fix locally for my own projects, so I am no
longer blocked by this. I took my own time to debug the root cause and
submit this PR purely to help the open-source community.
The code, the fix, and the root cause are all provided right here. If you
actually want to review the code and merge it to help other developers, go
ahead and do it. If you'd rather focus on notification glitches than the
actual bug fix, feel free to close this PR.
I'm not going to waste any more time arguing over a fix I've already solved
for myself.
…On Thu, 6 Aug, 2026, 10:55 pm stuartmorgan-g, ***@***.***> wrote:
*stuartmorgan-g* left a comment (flutter/packages#12373)
<#12373 (comment)>
@dhc-tech <https://github.com/dhc-tech> Whatever AI tool you are using to
post comments, please either fix it to stop spamming PRs, or stop using it.
Your last comment was posted and deleted 4 times in two minutes, causing
four separate email notifications to the team members subscribed to this
issue.
(And please do not post AI-generated sycophantic responses telling me that
I'm write to point that out, just fix the issue.)
Would you like me to file a new bug on the Google Issue Tracker and link
it here
The link to the upstream issue should be included in the code comment
where I left the review note about it.
—
Reply to this email directly, view it on GitHub
<#12373?email_source=notifications&email_token=BD3H3AJXKQK6IUS4TOMG25L5IS5PRA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMRQG43TSNZQGEYKM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-5207797010>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BD3H3AKEHGMN6FF6DGZ6STL5IS5PRAVCNFSNUABEKJSXA33TNF2G64TZHM4TSMBUGU3DAMR3JFZXG5LFHM2TANRXGM2DQMZYG6QXMAQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Apologies; I have seen quite a few cases of comments being rapidly deleted and re-posted several times recently, and in every case the explanation given was that it was done by an agent. Given that, and the established use of AI previously here, I didn't see any reason to expect it wasn't an agent in this case.
I reviewed it yesterday, and left a review comment.
The review comment would need to be addressed before we would merge it.
It is not either/or. I reviewed the PR, and I also provided feedback about a process issue that is disruptive to the team. You may not feel that it's important, but if you were regularly managing hundreds of PRs you would likely have a different perspective. |
93636c8 to
086c513
Compare
|
@stuartmorgan-g Update on the upstream issue (https://issuetracker.google.com/issues/543937345): it's been accepted, and a Google engineer looped in the
They're now weighing two systemic fixes across AndroidX:
No ETA yet, and it may extend beyond just |
camsim99
left a comment
There was a problem hiding this comment.
This LGTM. Thanks for all of the context and filing the upstream issue!
|
autosubmit label was removed for flutter/packages/12373, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
Updated version to 0.7.4+6 and added a new dependency to resolve compilation issues.
|
autosubmit label was removed for flutter/packages/12373, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
@gmackall Hey — noticed this PR's checks were stuck on Is this a known flake right now, or should I just retry the check? |
|
What's the state of this? Out build is blocked by it as well. |
|
autosubmit label was removed for flutter/packages/12373, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
This is blocked on flutter/flutter#191149 |
|
....since this is blocked, we can also keep an eye out for the upstream fix and instead bump version instead. According to the bug:
|
|
Looks like it is not blocked anymore? |
…r#191420) flutter/packages@fdd7d39...1785501 2026-08-20 [email protected] [material_ui] Cleans up shader files and exposes ink_splash shader (flutter/packages#12421) 2026-08-19 [email protected] [material_ui] Fixes typo in code and tests (flutter/packages#12503) 2026-08-19 [email protected] [pigeon] Fixes lint error from unused codec (flutter/packages#12512) 2026-08-19 [email protected] [camera_android_camerax] Add explicit concurrent-futures dependency (flutter/packages#12373) 2026-08-19 [email protected] [go_router] migrates to material_ui and cupertino_ui (flutter/packages#12504) 2026-08-19 [email protected] [animations] Migrate to material_ui (flutter/packages#12467) 2026-08-19 [email protected] [material_ui] Add Material tokens (version 38.2.50) (flutter/packages#12471) 2026-08-19 [email protected] Add `triage-design` label (flutter/packages#12488) 2026-08-19 [email protected] [google_maps_flutter_platform_interface] Fix PinConfig code sample (flutter/packages#12259) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…ent-futures workaround (#12698) Bumps `cameraxVersion` from 1.6.1 to 1.6.2. This release includes an upstream fix (https://issuetracker.google.com/issues/543937345) removing the JSpecify type-use annotation that required consumers to explicitly declare `androidx.concurrent:concurrent-futures` on their compile classpath. With 1.6.2, that workaround (added in #12373) is no longer needed, so this PR removes the explicit dependency and its regression test. Verified the fix is actually present in the published 1.6.2 artifact by decompiling `SurfaceRequest.class` from `camera-core-1.6.2.aar` — the `mSurfaceRecreationCompleter` field no longer carries the JSpecify `@NonNull` type annotation that caused the original compile failure. Fixes flutter/flutter#190505 ## Pre-Review Checklist
…ent-futures workaround (flutter#12698) Bumps `cameraxVersion` from 1.6.1 to 1.6.2. This release includes an upstream fix (https://issuetracker.google.com/issues/543937345) removing the JSpecify type-use annotation that required consumers to explicitly declare `androidx.concurrent:concurrent-futures` on their compile classpath. With 1.6.2, that workaround (added in flutter#12373) is no longer needed, so this PR removes the explicit dependency and its regression test. Verified the fix is actually present in the published 1.6.2 artifact by decompiling `SurfaceRequest.class` from `camera-core-1.6.2.aar` — the `mSurfaceRecreationCompleter` field no longer carries the JSpecify `@NonNull` type annotation that caused the original compile failure. Fixes flutter/flutter#190505 ## Pre-Review Checklist
camera_android_camerax's Gradle module does not explicitly declare a dependency onandroidx.concurrent:concurrent-futures. Verified viaandroidx.camera:camera-core:1.6.1's own Gradle module metadata (.modulefile):camera-coredeclaresandroidx.concurrent:concurrent-futuresonly on its runtime variant (releaseVariantReleaseRuntimePublication), not its api/compile variant (releaseVariantReleaseApiPublication). So when a consumer compiles againstcamera-core, Gradle correctly does not putconcurrent-futureson the compile classpath — that's not a resolution bug, it's whatcamera-core's own metadata declares.However,
camera-core's compiledSurfaceRequest.classcarries a compile-time-retained jspecify@NonNulltype annotation on a member typedandroidx.concurrent.futures.CallbackToFutureAdapter. javac needs that class on the compile classpath to fully process the annotation metadata during compilation — even though nocamera_android_camerax(orcamera-core) source calls it directly. This is a mismatch incamera-core's own packaging (a type needed at compile time for annotation processing, but declared runtime-only), which the Flutter team can't fix upstream sincecamera-coreis owned by the AndroidX/Jetpack team. Declaring the dependency explicitly incamera_android_cameraxworks around it.Confirmed 100% reproducible on a completely stock, uncustomized
flutter createapp on current stable (3.44.8, default AGP 9.0.1, compileSdk 37):fails every time with:
Minimal repro repo (steps + README with root cause): https://github.com/dhc-tech/camera-android-camerax-build-repro
List which issues are fixed by this PR:
Fixes flutter/flutter#190505
Pre-Review Checklist
camera-core's published Gradle module metadata before submitting.[camera_android_camerax]0.7.4+5).///). N/A — no public API surface changed, only a build-file dependency.ConcurrentFuturesDependencyTest.javareferencesCallbackToFutureAdapter.classdirectly, so the test target fails to compile (not just a runtime failure) if the dependency is ever dropped again.If you need help, consider asking for advice on the #hackers-new channel on Discord.