-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[Android 16] Bumped Android Defaults in Example Plugins #9241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
done |
Ok I think it might be valuable to pick one and use the android studio tool to see what they update. It is pretty common for there to be flags or files that also get modified that are not required but are best practices. If nothing changes except for what you have in this pr great, if not then we should look at the difference and see if it is a change that should be applied more broadly. |
NON blocking comment. |
I did. I ended up using the command Camille suggested for Gradle. It caught some example packages I didn't catch (rfw specifically). Everything should be accounted for. |
Filed flutter/flutter#169151 so we remember :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but what's the reason for suppressing the UseRequiresApi lint violations instead of changing to match the lint's guidance?
I suppressed the lint violations because I didn't want to introduce any potential behavorial changes in this PR. |
…9264) > [!NOTE] > This should land after #9241, which should safely bumps the AGP version of this plugin's example app higher than this PR does. Fixes flutter/flutter#168551 by implementing the `enableAudio` camera setting for video recording. Also: - Bumps CameraX library version to the latest version,`1.5.0-beta01` (to use a new CameraX method in this implementation) - Bumps the plugin AGP version to that which `1.5.0-beta01` requires (`8.6.0`) - Bumps the plugin's example app AGP version to that which `1.5.0-beta01` requires (`8.6.0`) -- will be overridden by #9241 - Corrects the example app to use the `enableAudio` setting just as the app-facing camera widget does - Adds lint errors caused by the **pigeon generated** `CameraXLibrary.g.kt` file caused by the `1.5.0-beta01` bump to a `lint-baseline.xml` file (all the errors are [`UnsageOptInUsage`](https://googlesamples.github.io/android-custom-lint-rules/checks/UnsafeOptInUsageError.md.html) lints caused by the plugin's [`ExperimentalCamera2Interop`](https://developer.android.com/reference/androidx/camera/camera2/interop/ExperimentalCamera2Interop) usage which is unrelated to this PR) ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
flutter/packages@af0b9a9...6eebe72 2025-05-27 [email protected] [flutter_lints] Bump lints dependency to 6.0.0 and bump package to 6.0.0 (flutter/packages#9108) 2025-05-26 [email protected] Roll Flutter from 60050a0 to 4372bfb (6 revisions) (flutter/packages#9322) 2025-05-26 [email protected] [video_player_android] Add note about Android platform views known issue (flutter/packages#9312) 2025-05-24 [email protected] Roll Flutter from 85564cb to 60050a0 (17 revisions) (flutter/packages#9318) 2025-05-23 [email protected] [camera_android_camerax] Implement `enableAudio` for video recording (flutter/packages#9264) 2025-05-23 [email protected] [video_player_android] isBuffering flag always return true after calling seekTo method - fixed (flutter/packages#9198) 2025-05-23 [email protected] [camera,video_player] replace onSurfaceDestroyed with onSurfaceCleanup (flutter/packages#9316) 2025-05-23 [email protected] [camera,video_player] Update Android to 3.29 minimum (flutter/packages#9317) 2025-05-23 [email protected] Roll Flutter from 33cdd8e to 85564cb (39 revisions) (flutter/packages#9315) 2025-05-23 [email protected] Update repo for 3.32 stable (flutter/packages#9311) 2025-05-23 [email protected] [camera_avfoundation] Correct pigeon configuration output paths (flutter/packages#9313) 2025-05-23 [email protected] [process] Remove from the repository (flutter/packages#9310) 2025-05-22 [email protected] Ensure Example Packages Work on Android API 36 (flutter/packages#9241) 2025-05-22 [email protected] Roll Flutter (stable) from c236373 to be698c4 (1274 revisions) (flutter/packages#9300) 2025-05-22 [email protected] Remove CODEOWNER for generated iOS files (flutter/packages#9272) 2025-05-22 [email protected] [google_maps_flutter] Removes unnecessary parentheses (flutter/packages#9273) 2025-05-21 [email protected] Rebalance Android plugin CODEOWNERS (flutter/packages#9298) 2025-05-21 [email protected] Roll Flutter from 9a78af5 to 33cdd8e (60 revisions) (flutter/packages#9305) 2025-05-21 [email protected] [ci] Update repository for 3.29 release (flutter/packages#9270) 2025-05-21 [email protected] Ignore .cxx/ directories (flutter/packages#9268) 2025-05-21 [email protected] [video_player] Skip some integration tests on web (flutter/packages#9302) 2025-05-21 [email protected] [webview_flutter] Adds support to respond to recoverable SSL certificate errors (flutter/packages#9150) 2025-05-19 [email protected] [camera_android_camerax] Swap out `BroadcastReceiver` for `OrientationEventListener` (flutter/packages#9261) 2025-05-19 [email protected] [video_player_android] Fix incorrect dimensions swap (flutter/packages#9199) 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
Ensured the example plugin apps on Android work on Android API 36 by updating configurations and sucessfully running `flutter build apk` (means the app can successfully build + all dependencies are resolvable). For compatibility with Android API 36, the example plugin apps on Android should have the following configurations: `targetSdk`: 36 `compileSdk`: 36 AGP version: 8.9.1 Gradle version: 8.11.1 Most packages no longer require a manual bump of `targetSdk` and `compileSdk` due to usage of values from Flutter Gradle Plugin. Below is a list of example plugin apps on Android: Partially Adresses flutter/flutter#163071 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
…lutter#9264) > [!NOTE] > This should land after flutter#9241, which should safely bumps the AGP version of this plugin's example app higher than this PR does. Fixes flutter/flutter#168551 by implementing the `enableAudio` camera setting for video recording. Also: - Bumps CameraX library version to the latest version,`1.5.0-beta01` (to use a new CameraX method in this implementation) - Bumps the plugin AGP version to that which `1.5.0-beta01` requires (`8.6.0`) - Bumps the plugin's example app AGP version to that which `1.5.0-beta01` requires (`8.6.0`) -- will be overridden by flutter#9241 - Corrects the example app to use the `enableAudio` setting just as the app-facing camera widget does - Adds lint errors caused by the **pigeon generated** `CameraXLibrary.g.kt` file caused by the `1.5.0-beta01` bump to a `lint-baseline.xml` file (all the errors are [`UnsageOptInUsage`](https://googlesamples.github.io/android-custom-lint-rules/checks/UnsafeOptInUsageError.md.html) lints caused by the plugin's [`ExperimentalCamera2Interop`](https://developer.android.com/reference/androidx/camera/camera2/interop/ExperimentalCamera2Interop) usage which is unrelated to this PR) ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Ensured the example plugin apps on Android work on Android API 36 by updating configurations and sucessfully running `flutter build apk` (means the app can successfully build + all dependencies are resolvable). For compatibility with Android API 36, the example plugin apps on Android should have the following configurations: `targetSdk`: 36 `compileSdk`: 36 AGP version: 8.9.1 Gradle version: 8.11.1 Most packages no longer require a manual bump of `targetSdk` and `compileSdk` due to usage of values from Flutter Gradle Plugin. Below is a list of example plugin apps on Android: Partially Adresses flutter/flutter#163071 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
…lutter#9264) > [!NOTE] > This should land after flutter#9241, which should safely bumps the AGP version of this plugin's example app higher than this PR does. Fixes flutter/flutter#168551 by implementing the `enableAudio` camera setting for video recording. Also: - Bumps CameraX library version to the latest version,`1.5.0-beta01` (to use a new CameraX method in this implementation) - Bumps the plugin AGP version to that which `1.5.0-beta01` requires (`8.6.0`) - Bumps the plugin's example app AGP version to that which `1.5.0-beta01` requires (`8.6.0`) -- will be overridden by flutter#9241 - Corrects the example app to use the `enableAudio` setting just as the app-facing camera widget does - Adds lint errors caused by the **pigeon generated** `CameraXLibrary.g.kt` file caused by the `1.5.0-beta01` bump to a `lint-baseline.xml` file (all the errors are [`UnsageOptInUsage`](https://googlesamples.github.io/android-custom-lint-rules/checks/UnsafeOptInUsageError.md.html) lints caused by the plugin's [`ExperimentalCamera2Interop`](https://developer.android.com/reference/androidx/camera/camera2/interop/ExperimentalCamera2Interop) usage which is unrelated to this PR) ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
@@ -31,7 +31,7 @@ buildFeatures { | |||
buildConfig true | |||
} | |||
namespace 'io.flutter.plugins.camera' | |||
compileSdk = flutter.compileSdkVersion | |||
compileSdk = 36 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jesswrd @stuartmorgan-g is this an intentional change?
Why do this only for the camera_android
and not for any other plugins?
This change forces plugin users to use compileSdk 36 for all other Android plugins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked to @jesswrd and determined this was a mistake! We'll undo it. Thanks for the heads up!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jesswrd I thought I had a test that verified flutter.compileSdkVersion was used.
if (compileSdkLine.contains('flutter.compileSdkVersion')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually enforcing that it's used could be tricky; couldn't we potentially need to set this higher than compileSdkVersion
in order to (conditionally at runtime) adopt a new API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably not for compileSdkVersion but possibly for targetSdkVersion or minSdkVersion. Compile normally should be the highest published value and does not change the behavior of running apps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compile normally should be the highest published value
Right, but we support multiple versions of Flutter, and the flutter.compileSdkVersion
for a given version is a fixed value that does not change with the reality of what the highest published value is.
The scenario I am thinking of is:
- Flutter
stable
, N-1, and N-2 have aflutter.compileSdkVersion
of X. - SDK version X+1 comes out.
- It's adopted as
flutter.compileSdkVersion
onmaster
. - We want to use some API (with appropriate runtime checks) that was introduced in X+1 in plugin
foo
.
Isn't the desired action in that case to temporarily change foo
's compileSdk
to X+1, so that we can use the new API without waiting for it to filter to stable
(and have us drop N-1 and N-2 support just for that)?
yeah that is fair didnt think about version skew across versions of flutter
when I should have.
…On Wed, Jul 23, 2025 at 3:00 PM stuartmorgan-g ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In packages/camera/camera_android/android/build.gradle
<#9241 (comment)>:
> @@ -31,7 +31,7 @@ buildFeatures {
buildConfig true
}
namespace 'io.flutter.plugins.camera'
- compileSdk = flutter.compileSdkVersion
+ compileSdk = 36
Compile normally should be the highest published value
Right, but we support multiple versions of Flutter, and the
flutter.compileSdkVersion for a given version is a fixed value that does
not change with the reality of what the highest published value is.
The scenario I am thinking of is:
- Flutter stable, N-1, and N-2 have a flutter.compileSdkVersion of X.
- SDK version X+1 comes out.
- It's adopted as flutter.compileSdkVersion on master.
- We want to use some API (with appropriate runtime checks) that was
introduced in X+1 in plugin foo.
Isn't the desired action in that case to temporarily change foo's
compileSdk to X+1, so that we can use the new API without waiting for it
to filter to stable (and have us drop N-1 and N-2 support just for that)?
—
Reply to this email directly, view it on GitHub
<#9241 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIDVLAMZCEUNBD7T7GL7ET3J7LVZAVCNFSM6AAAAAB44YEKMKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTANBYGY2DMNZZGU>
.
You are receiving this because your review was requested.Message ID:
<flutter/packages/pull/9241/review/3048646795 ***@***.***
com>
|
@reidbaker Oops just saw this. I made the change to the |
There is unfortunately no way to prominently surface warnings in the GitHub UI, and people almost never look at full CI output unless something is wrong or they are actively checking for a specific thing, so printing warning output for something like this is, in practice, essentially useless. If the goal is to enforce it as a general rule but allow people to override it if they really mean to, the only workable pattern we've developed for that is the |
Ensured the example plugin apps on Android work on Android API 36 by updating configurations and sucessfully running
flutter build apk
(means the app can successfully build + all dependencies are resolvable). For compatibility with Android API 36, the example plugin apps on Android should have the following configurations:targetSdk
: 36compileSdk
: 36AGP version: 8.9.1
Gradle version: 8.11.1
Most packages no longer require a manual bump of
targetSdk
andcompileSdk
due to usage of values from Flutter Gradle Plugin. Below is a list of example plugin apps on Android:Partially Adresses flutter/flutter#163071
Pre-Review Checklist
[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3