-
Notifications
You must be signed in to change notification settings - Fork 29k
Reland engine display features #89511
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
Reland engine display features #89511
Conversation
There are two remaining issues that need to be solved:
These version bumps (kotlin, android API and AGP) need to be dealt with eventually. Is there anything in the tooling or framework that helps with old plugins or old apps that I'm missing? @blasten Could you please advise? I'm asking because of #71964 |
@andreidiaconu I filed #89609. Does your change require to bump the |
Yes, it does.
…On Wed, 8 Sep 2021 at 00:38 Emmanuel Garcia ***@***.***> wrote:
@andreidiaconu <https://github.com/andreidiaconu> I filed #89609
<#89609>. Does your change
require to bump the targetSdkVersion/compileSdkVersion?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#89511 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKWJPWJ7WIWNVNTGI3HVZDUA2A4ZANCNFSM5DPB76AA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
does it mean that your change will break older apps that don't update these? |
Yes, unfortunately, unless I am missing something.
Edit:
- For `targetSdkVersion`/`compileSdkVersion` no
- For AGP version 3, yes
- For AGP 4 and up, no
…On Wed, 8 Sep 2021 at 00:41 Emmanuel Garcia ***@***.***> wrote:
does it mean that your change will break older apps that don't update
these?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#89511 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKWJPRLERU7QPNXCZFLMW3UA2BHDANCNFSM5DPB76AA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
This is problematic then. I'm not sure what the next step should be, other than split the changes so that the activation requires a manual step. You mentioned that this is is hard to land as a plugin, but can a portion of this change land as a plugin? In particular, the code that brings the Android dependency, and requires a higher SDK? |
I will get back to you on this. It’s possible that only the AGP version
bump breaks older apps, while the SDK version does not. I need to run some
tests first, especially since the conclusions we draw here affect the way I
can proceed with this.
As for the Android dependecy as a plugin, I’m not sure how that would work,
but I will research a way to opt-in if we conclude that there is no way
around it.
…On Wed, 8 Sep 2021 at 00:47 Emmanuel Garcia ***@***.***> wrote:
This is problematic then. I'm not sure what the next step should be, other
than split the changes so that the activation requires a manual step.
You mentioned that this is is hard to land as a plugin, but can a portion
of this change land as a plugin? In particular, the code that brings the
Android dependency, and requires a higher SDK?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#89511 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKWJPRKLBU5XQEMP2AYXYLUA2CAJANCNFSM5DPB76AA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@blasten For an application to run into issues, it would need to use AGP version 3. The framework templates is are set to version Older apps still using AGP 3 are already forced to update if they try using plugins with newer version of kotlin. Here is an example issue of this happening #83834 . Moving forward, less and less apps will even be able to use AGP 3 due to this lack of compatibility with newer kotlin. It only takes one plugin to use it for the developer to be forced to update AGP. For more exact numbers, |
Thanks for the research. In this case, it sounds like reverting the |
@blasten I spoke to soon on I will keep you updated and sorry for my confusion |
@blasten I discussed with the androidx team and they will not lower the Bringing in
|
|
Hey @andreidiaconu thank you for all of your work and research on this. I am just catching up on it. :) |
Yes, I want to continue with compileSdkVersion 31.
…On Fri, 1 Oct 2021 at 22:09 Kate Lovett ***@***.***> wrote:
Hey @andreidiaconu <https://github.com/andreidiaconu> thank you for all
of your work and research on this. I am just catching up on it. :)
Given your last update, do you want to proceed with this change using compileSdkVersion
31? I am here to help move this along, so let me know if there is
anything I can do to assist.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#89511 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKWJPRBTDL4QJUEOZRZRQTUEYBPDANCNFSM5DPB76AA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Ok thanks for clarifying! :) |
Thanks @Piinks. Andrei, I'm sorry this is taking longer, or that this issue wasn't brought up earlier. (I was collecting information from the design doc reviewers.) I'd like to see a proposal where we define an interface with a default implementation that doesn't require any of these changes to an app. At a high level, I'm mostly concerned that new features all the sudden require new embedding dependencies, or migrations guidelines for everyone, even if an app doesn't use these features. AndroidX libraries themselves were carefully designed, so they can be included in an app as needed. I'd like to see how that model can work in Flutter as well. There are exceptions to this model. e.g. Android's lifecycle was a necessary dependency that had our team debating for nearly a quarter (cc @xster). Given that the communication channel between the framework and the native side is platform channels, what sort of limitation do you see by having an interface with two different implementations? That is, one shipped as a plugin that requires the changes to the app you are suggesting, and one with a default (no-op) implementation. |
One limitation I see is that viewport metrics can get out of sync, which is
why (to my recollection) we opted to use existing engine methods directly
for delivering that data from android to engine to dart.
Just to make sure that we avoid confusion, I would like to say that display
features (these changes) are not using platform channels, but method calls
on the engine directly.
Regarding high level concerns:
Having a less coupled system for adding features to the engine and
framework sounds good, but it seems like a bigger change, compared to this
one feature. It would require refactoring the engine. If what you had in
mind is not a system for existing and future features, I think I
misunderstood.
For this feature specifically, communication could be moved from calling
engine methods to platform channels, but there are several implications if
we go down this path:
- Agreement from initial reviewers.
- A rewrite of the engine PR. Most of the code is specific to the method we
chose to use.
- Introduction of a new concept: Parts of Flutter (display features, in
this case) would not work unless you also include a package in pubspec —
but you would not get any error. This has its own implications, like the
need for lint rules or other mechanisms for making sure apps that use this
feature don’t get shipped without including the feature package.
When you say you would like to see a proposal based on interfaces with
default implementations, do you mean
- for this feature specifically or
- in general as a path for engine and framework contributions
and
- who do you see owning the proposal?
- what happens to this feature while this system is being developed?
…On Fri, 1 Oct 2021 at 22:36 Emmanuel Garcia ***@***.***> wrote:
Thanks @Piinks <https://github.com/Piinks>. Andrei, I'm sorry this is
taking longer, or that this issue wasn't brought up earlier. (I was
collecting information from the design doc
<https://docs.google.com/document/d/1GpGok1btvPlfK24cBQY9D1mlsxT_EQ5RTGJuewaRr3o/edit?resourcekey=0-4pQAmbSPppAGxDIbJubBFw#heading=h.pub7jnop54q0>
reviewers.)
I'd like to see a proposal where we define an interface with a default
implementation that doesn't require any of these changes to an app. At a
high level, I'm mostly concerned that new features all the sudden require
new embedding dependencies, or migrations guidelines for everyone, even if
an app doesn't use these features.
AndroidX libraries themselves were carefully designed, so they can be
included in an app as needed. I'd like to see how that model can work in
Flutter as well.
There are exceptions to this model. e.g. Android's lifecycle was a
necessary dependency that had our team debating for nearly a quarter (cc
@xster <https://github.com/xster>).
Given that the communication channel between the framework and the native
side is platform channels, what sort of limitation do you see by having an
interface with two different implementations? That is, one shipped as a
plugin that requires the changes to the app you are suggesting, and one
with a default (no-op) implementation.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#89511 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKWJPQRZB6OHKQXIMVJTGLUEYET5ANCNFSM5DPB76AA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Looking at flutter/engine#24756, it seems doable to add a method (e.g. Lastly, a plugin could have a Would there be an issue with this approach? |
The engine and framework would still need to know about the concept of
display features (viewport metrics would contain display features). The
framework would still use display features but they would not be populated
by default. Developers might expect them to work, without any obvious
signal that they don’t, unless they also include a plugin.
Are we doing all of this to avoid bumping compileSdkVersion from 30 to 31?
…On Sat, 2 Oct 2021 at 04:07 Emmanuel Garcia ***@***.***> wrote:
One limitation I see is that viewport metrics can get out of sync, which is
why (to my recollection) we opted to use existing engine methods directly
for delivering that data from android to engine to dart.
Looking at flutter/engine#24756
<flutter/engine#24756>, it seems doable to add a
method (e.g. buildFlutterView()) to FlutterActivity that allows to
override the implementation of FlutterView. You could subclass FlutterView
and add the changes added to the engine that use the androidx.window.*
packages.
Lastly, a plugin could have a FlutterView subclass as well as
WindowInfoRepositoryCallbackAdapterWrapper class. Then, the only step for
a developer becomes overriding the buildFlutterView() in FlutterActivity,
and bumping compileSdkVersion.
Would there be an issue with this approach?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#89511 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKWJPRITJVS76JBFTAW67LUEZLOLANCNFSM5DPB76AA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
...and the embedding dependency. Bumping |
newBuildGradle = buildGradle.replaceAll( | ||
androidPluginRegExp, 'com.android.tools.build:gradle:3.3.0'); | ||
buildGradleFile.writeAsStringSync(newBuildGradle); | ||
|
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.
@blasten This version of AGP is not compatible with the latest kotlin, which androidx requires.
@@ -179,7 +179,7 @@ class MultidexProject extends Project { | |||
defaultConfig { | |||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). | |||
applicationId "com.example.multidextest2" | |||
minSdkVersion 16 | |||
minSdkVersion 19 |
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.
@blasten From test results I see that cloud_firestore
, used in this test project, requires minSdkVersion 19
. I am not sure why this test fails now instead of failing in past builds as well.
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.
this could happen if a dependency is resolved to a newer version that has minSdkVersion:19.
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.
Yes, but I still wanted to highlight a few of the issues/fixes I think you should be aware of. With the lockfiles, there's a lot of modified files and I would not want such things to go unnoticed.
dev/integration_tests/flutter_gallery/android/app/src/main/AndroidManifest.xml
Outdated
Show resolved
Hide resolved
Does |
It turns green when all tests are passing on master. In this case, one test failed in the last invocation, so I retriggered it. |
From what I see, one of the red areas in https://ci.chromium.org/p/flutter/g/flutter/console relates to one of the tests also fixed in this PR (failure caused by firebase requiring minSdk 19 instead of 16). |
Got it. |
…ter#93098)" This reverts commit 7779ad3.
This reverts commit 058dfd4.
Relands #89430
For context, this engine change flutter/engine#24756 adds display features on Android, provided by Jetpack WindowManager (
androidx.window
). Since this adds a new library, the gradle dependecy lockfiles need to be updated and because the library requirescompileSdkVersion 31
, the gradle build files need to be updated.List which issues are fixed by this PR. You must list at least one issue.
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.