Closed yasargil closed 3 years ago
Hi @yasargil
Thanks for filing the issue, I can reproduce it oniOS 14.4
physical and iOS 13.7
simulator, no issue on Android
iOS | Android |
---|---|
Thank you
Just a wild guess but could it be that this change is responsible. I am almost sure that it did not see that behaviour bevor November. @cyanglaz @flar https://github.com/flutter/engine/pull/22336
Edit. If we use an Scrollcontroller to jump to an offset without animation the issue is even more visible because the map stays in place over all other content. I think the map does not get redrawn if it is offscreen in the next frame.
Edit2: If we push a new route over the map it is still visible.
In the video we can see that the map in the route below bleeds into the top route on pop for some/one frames. This happens only when both routes have a native view. https://user-images.githubusercontent.com/7766525/111281761-953f1b00-863d-11eb-8796-3cef61472a13.MP4
I just confirmed this is happening with flutter 2.0.1 as well and only for iOS. You get the same behavior with both GoogleMap and WebView within a vertically scrollable widget.
Anyone find a workaround for this?
I have confirmed with bisection that https://github.com/flutter/engine/pull/22336 was where this problem arose. I have a couple of ideas for fixing it.
i can confirm it as regression
webview (1.22.6) | webiew (2.1) | maps (1.22.6) | maps (2.1) |
---|---|---|---|
I can confirm this happening on Flutter 2.0 with the mapbox_gl Plugin (which also uses a PlatformView).
@xster @gaaclarke on https://github.com/flutter/engine/pull/25161 (which is a bit of a hack) @flar suggests that "A better fix would be to modify the iOS embedder so that it paints nothing if its Paint() method is not actually called." This appears to already be the behavior in the Android embedder. Do either of you know where to look? Could be a small fix.
@zanderso I'm not quite sure, the platform views implementation is divorced quite a bit from the underlying platform, I know a fraction of what the platform views engineers know. If I was looking into this bug, I'd investigate the geometry (frame) of the layer that is being rendered. I know there is some magic to synchronize the layer's geometry (frame) to match where it should go in relation to the Flutter renderer. It appears that code is out of wack, potentially stopping updating the frame of the layer one screen render (frame) prematurely.
Is there any progress on this issue? Can we add this (hack) to next flutter version? It is better to have working hack than not working platform views in scrollable widgets.
I will take a look at this. Might update the milestone when I understand what's going on and can give a more accurate estimate
Here's the bug im facing, basically jump scroll wont clear out the google map render cache https://user-images.githubusercontent.com/13378059/113733524-20876a00-972d-11eb-98d9-42dc749d6aea.MP4
I will take a look at this. Might update the milestone when I understand what's going on and can give a more accurate estimate
Does this mean that this will be fixed at July Beta Release (1.32) and till July it most likely will be not fixed? That's sad, because of this only issue I can't update the app to Flutter 2.0.
Does anyone know any workaround that I can use to fix the issue?
I will take a look at this. Might update the milestone when I understand what's going on and can give a more accurate estimate
Does this mean that this will be fixed at July Beta Release (1.32) and till July it most likely will be not fixed? That's sad, because of this only issue I can't update the app to Flutter 2.0.
Does anyone know any workaround that I can use to fix the issue?
My temporary workaround was using the custom list view physics and reduce the max velocity of the scroller
class CustomScrollPhysics extends ScrollPhysics {
const CustomScrollPhysics({ScrollPhysics parent}) : super(parent: parent);
@override
CustomScrollPhysics applyTo(ScrollPhysics ancestor) {
return CustomScrollPhysics(parent: buildParent(ancestor));
}
@override
Simulation createBallisticSimulation(ScrollMetrics position, double velocity) {
// When it scrolls out of screen, use the original physics to bouncing back
if (position.outOfRange)
return super.createBallisticSimulation(position, velocity);
...
return ClampingScrollSimulation(
position: position.pixels,
velocity: velocity / 3, // can use 1/2 or 1/3 for better user experience
tolerance: tolerance,
);
}
}
Once the max scrolling velocity was reduced, the platform view blocking area would be small and only appear on the edge of top/bottom and won't cover the main center content.
FYR and Hope it helps :)
I will take a look at this. Might update the milestone when I understand what's going on and can give a more accurate estimate
Does this mean that this will be fixed at July Beta Release (1.32) and till July it most likely will be not fixed? That's sad, because of this only issue I can't update the app to Flutter 2.0. Does anyone know any workaround that I can use to fix the issue?
My temporary workaround was using the custom list view physics and reduce the max velocity of the scroller
class CustomScrollPhysics extends ScrollPhysics { const CustomScrollPhysics({ScrollPhysics parent}) : super(parent: parent); @override CustomScrollPhysics applyTo(ScrollPhysics ancestor) { return CustomScrollPhysics(parent: buildParent(ancestor)); } @override Simulation createBallisticSimulation(ScrollMetrics position, double velocity) { // When it scrolls out of screen, use the original physics to bouncing back if (position.outOfRange) return super.createBallisticSimulation(position, velocity); ... return ClampingScrollSimulation( position: position.pixels, velocity: velocity / 3, // can use 1/2 or 1/3 for better user experience tolerance: tolerance, ); } }
Once the max scrolling velocity was reduced, the platform view blocking area would be small and only appear on the edge of top/bottom and won't cover the main center content.
FYR and Hope it helps :)
As I do understand that doesn't fix the problem, but just makes it less visible :(
I will take a look at this. Might update the milestone when I understand what's going on and can give a more accurate estimate
We have spend a lot of effort to move to Flutter 2.0 with null safety and what not, only to find out the ads package we use, suffers from the same issue others are facing for google maps or web view. This issue completely ruins the user experience with having the ads appear out of place when the users scrolls the listview, most times hiding some important UI components, essentially rending the app useless and we seeing a big impact of that in the time the users spend on our app.
There are so many effected packages/users with this bug, really surprised to see it is considered such low priority that its scheduled for July! Can someone please increase the priority of this issue?
I will take a look at this. Might update the milestone when I understand what's going on and can give a more accurate estimate
Just to name a few issues impacted by this bug for an googleads package.
same here after migrate to flutter 2 all ads plugins banner is floating and something goes wrong with ads and video players performance and the UI , i just got back to flutter 1.66.2 and all fine there .
android 8 and 10: it works fine and no floating issues but have a bad performance i don't know if this caused by the plugin googleads-mobile-flutter
or by flutter 2 but its fine overall
andorid 5 : the ads makes the app to crash when ads appear and it gives me this kind of errors after integrate sentry
I/Ads ( 4439): Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("3AE64AB069F1295E3CB0DF0395543D38")) to get test ads on this device.
I/AdCheck ( 4439): APS: blockAdView: android.widget.FrameLayout{3567934 G.E...... ......ID 0,0-720,1208 #1020002 android:id/content}
I/cr_Ime ( 4439): ImeThread is enabled.
W/cr_BindingManager( 4439): Cannot call determinedVisibility() - never saw a connection for the pid: 4439
I/AdCheck ( 4439): APS: blockAdView: com.google.android.gms.ads.internal.webview.ac{2b3a81 GFE.HV... ......I. 0,0-0,0}
I/AdCheck ( 4439): APS: blockAdView: com.google.android.gms.ads.internal.webview.y{b03b8b9 G.E...... ......I. 0,0-0,0}
I/cr_Ime ( 4439): ImeThread is enabled.
W/cr_BindingManager( 4439): Cannot call determinedVisibility() - never saw a connection for the pid: 4439
[log] interstitialAd onAdLoaded Maps
I/SendBroadcastPermission( 4439): action:huawei.intent.action.APS_UPDATE_DATA_ACTION, mPermissionType:0
I/AdCheck ( 4439): APS: blockAdView: android.widget.FrameLayout{8ffbfe9 G.E...... ......I. 0,0-0,0 #1020002 android:id/content}
E/art ( 4439): invalid stream - problem with parameter iterator in /data/data/com.google.android.gms/app_chimera/m/0000000b/dl-AdsFdrDynamite.integ_210402101000000.apk for method void com.google.android.gms.ads.nonagon.ad.event.p.a(java.lang.Object)
iOS 12.5.1 and 14.3 : the ads floating and stuck over my App UI
and again , all this issues just appear after migrate to flutter 2 and all was good with flutter 1.66.2 with same plugin and dart 2.10.5
My current Flutter version is 2.0.5 and the issue still going
same here after migrate to flutter 2 all ads plugins banner is floating and something goes wrong with ads and video players performance and the UI , i just got back to flutter 1.66.2 and all fine there .
testing :
android 8 and 10: it works fine and no floating issues but have a bad performance i don't know if this caused by the plugin
googleads-mobile-flutter
or by flutter 2 but its fine overallandorid 5 : the ads makes the app to crash when ads appear and it gives me this kind of errors after integrate sentry
I/Ads ( 4439): Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("3AE64AB069F1295E3CB0DF0395543D38")) to get test ads on this device. I/AdCheck ( 4439): APS: blockAdView: android.widget.FrameLayout{3567934 G.E...... ......ID 0,0-720,1208 #1020002 android:id/content} I/cr_Ime ( 4439): ImeThread is enabled. W/cr_BindingManager( 4439): Cannot call determinedVisibility() - never saw a connection for the pid: 4439 I/AdCheck ( 4439): APS: blockAdView: com.google.android.gms.ads.internal.webview.ac{2b3a81 GFE.HV... ......I. 0,0-0,0} I/AdCheck ( 4439): APS: blockAdView: com.google.android.gms.ads.internal.webview.y{b03b8b9 G.E...... ......I. 0,0-0,0} I/cr_Ime ( 4439): ImeThread is enabled. W/cr_BindingManager( 4439): Cannot call determinedVisibility() - never saw a connection for the pid: 4439 [log] interstitialAd onAdLoaded Maps I/SendBroadcastPermission( 4439): action:huawei.intent.action.APS_UPDATE_DATA_ACTION, mPermissionType:0 I/AdCheck ( 4439): APS: blockAdView: android.widget.FrameLayout{8ffbfe9 G.E...... ......I. 0,0-0,0 #1020002 android:id/content} E/art ( 4439): invalid stream - problem with parameter iterator in /data/data/com.google.android.gms/app_chimera/m/0000000b/dl-AdsFdrDynamite.integ_210402101000000.apk for method void com.google.android.gms.ads.nonagon.ad.event.p.a(java.lang.Object)
iOS 12.5.1 and 14.3 : the ads floating and stuck over my App UI
and again , all this issues just appear after migrate to flutter 2 and all was good with flutter 1.66.2 with same plugin and dart 2.10.5
My current Flutter version is 2.0.5 and the issue still going
Get used to using Flutter It will take half a year to fix it :) from the time the issue is reported.
I only hope in the July release they don't introduce another new bug :D
@mustafa-707 This issue is related to iOS and there is no crash
If you're experiencing an issue on Android, please file a new issue with all the details following the issue template
This is my second time encounter this issue, this is much more horrible and its totally nightmare for my app 😭 Could we just raise the priority?
Related issue, https://github.com/googleads/googleads-mobile-flutter/issues/115
I'm also having the same issue with google ads in Flutter 2.0. Could we add the found in release 2.0
label?
@zanderso, is there a plan to cherry pick the fix?
Thank you Flutter team for listening to the community! Glad to see the priority raised for this issue, much appreciated!
@blasten You can request a cherry-pick by applying appropriate tags to this issue, however the fix has not yet landed.
This has been rejected for 2.0 stable or cherrypicking. We'll discuss later branch cherrypicks in our Monday release meeting.
The fix for this issue was added to the engine in https://github.com/flutter/engine/commit/72114dafe28c8700f1d5d629c6ae9d34172ba395 and rolled to the framework as part of https://github.com/flutter/flutter/commit/2f6a52d6e0e9681f989ee7d3a1a338a06ed566a2
(Closing the issue since it is fixed, but cherrypicking comments and activity may still be ongoing...)
Hi @flar thanks for the fix , I just noticed that the ads is passing thru appbar in android as well. Im not sure whether it is related to this issue.
return Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize: Size(MediaQuery.of(context).size.width, 70),
child: GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
TokboardController.to.scrollToTop();
},
child: ClipRRect(
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 15, sigmaY: 15),
child: AppBar(
centerTitle: true,
backgroundColor: Colors.transparent,
toolbarHeight: 70,
elevation: 0,
title: Padding(
padding: const EdgeInsets.all(8.0),
child: GlithEffect(
child: Image.asset(
'assets/icon/zappy.png',
height: 50,
),
),
),
),
),
),
),
),
);
@sooxt98 it looks more like the BackdropFilter in the app bar isn't affecting the ads. This is a separate issue. It might be related to https://github.com/flutter/flutter/issues/80766 but it is sort of the opposite outcome. I would encourage you to file a separate issue so we can triage it properly.
@flar When can we expect this change in Flutter stable? Just checked right now - and platformview still have this problem on flutter 2.0.6
According to the current cp
labels on this issue, it is targeted for 2.2
@sooxt98 Hybrid composition of platform views doesn't support BackdropFilter
. I also don't think it works on iOS either. The list of supported filters is: https://github.com/flutter/flutter/issues/58426
It's not trivial to implement, but durable.
@flar Sorry but when Flutter 2.2 would be deployed in stable?
This regression is the only thing that is blocking me for migrating to Flutter 2, and obviously now all packages have already migrated against it. The problem is that the Google Play Store will require a minimum target API level 30 starting from November (August for new apps), which also requires all apps to be compliant with the new MANAGE_EXTERNAL_STORAGE
permission (https://support.google.com/googleplay/android-developer/answer/10467955).
Since in the timeline this issue was presented later than the Flutter 2 migrations, the majority of plugins (like open_file) have first migrated to Flutter 2, and then fixed the legacyExternalStorage
option, which is now banned with the new permission method.
This could mean that if the issue is not fixed in stable before November, it would be impossible for developers to release updates to their Android apps and iOS apps. Since the first would be suspended by Google by not respecting the new rules if we not upgrade to Flutter 2, and the latter by the Apple team which would find the clip in the app and block the review, if we upgrade to Flutter 2.
I'm not directly involve in the cherry picking process. Here is a pointer to the documentation about it:
https://github.com/flutter/flutter/wiki/Flutter-Cherrypick-Process
It was recently merged into a cherry-picking candidate. The events didn't show up here because the fix was referenced by commit hash which doesn't update the corresponding issue.
It was recently merged into a cherry-picking candidate. The events didn't show up here because the fix was referenced by commit hash which doesn't update the corresponding issue.
ahh, yeah, i should have also linked the issue on the PR description.
Sorry but when Flutter 2.2 would be deployed in stable? This regression is the only thing that is blocking me for migrating to Flutter 2, and obviously now all packages have already migrated against it. The problem is that the Google Play Store will require a minimum target API level 30 starting from November (August for new apps), which also requires all apps to be compliant with the new
MANAGE_EXTERNAL_STORAGE
permission (https://support.google.com/googleplay/android-developer/answer/10467955).Since in the timeline this issue was presented later than the Flutter 2 migrations, the majority of plugins (like open_file) have first migrated to Flutter 2, and then fixed the
legacyExternalStorage
option, which is now banned with the new permission method.This could mean that if the issue is not fixed in stable before November, it would be impossible for developers to release updates to their Android apps and iOS apps. Since the first would be suspended by Google by not respecting the new rules if we not upgrade to Flutter 2, and the latter by the Apple team which would find the clip in the app and block the review, if we upgrade to Flutter 2.
@kf6gpe Could we know why this issue was rejected on Flutter 2.0 stable hotfix? Also, this fix will be available on stable before the start of November 2021? As the cited post, we need it before that date because of Google Play store guidelines
We've significantly raised the bar given how long the 2.0 release has been in the channel, and this doesn't make the cut for Flutter 2.0.
We do a stable release approximately quarterly; I can't commit to dates, except to say that I'm confident it'll be in a stable release prior to then.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v
and a minimal reproduction of the issue.
When a GoogleMap Widget scrolls offscreen it will be not correctly clipped.
Steps to Reproduce
flutter create bug
.Add google maps dependency to pubspec.yaml and add your api key to appdelegate.
pubspec.yaml
```yaml dependencies: flutter: sdk: flutter google_maps_flutter: ^1.2.0 ```lib/main.dart
code sample
```dart import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: MyHomePage(title: 'Flutter Demo Home Page'), ); } } class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); final String title; @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends StateExpected results: The map is not visible anymore
Actual results: Depending on the scroll velocity a part of the map will still be visible
This happens on a iPhone Xr with iOS 13.2 in release and debug mode.
Logs
``` [✓] Flutter (Channel dev, 1.27.0-1.0.pre, on macOS 11.1 20C69 darwin-x64, locale de-CH) • Flutter version 1.27.0-1.0.pre at /Users/yasargil/tools/flutter • Framework revision 68c96f100e (vor 7 Tagen), 2021-02-08 16:14:15 -0800 • Engine revision b04955656c • Dart version 2.13.0 (build 2.13.0-0.0.dev) [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/yasargil/Library/Android/sdk • Platform android-30, build-tools 29.0.2 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.2, Build version 12B45b • CocoaPods version 1.10.0 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) [!] IntelliJ IDEA Community Edition (version 2017.1.4) • IntelliJ at /Applications/IntelliJ IDEA CE.app ✗ Flutter plugin version 14.0 - the recommended minimum version is 16.0.0 • Dart plugin version 171.4694.29 • For information about installing plugins, see https://flutter.dev/intellij-setup/#installing-the-plugins [✓] VS Code (version 1.53.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.19.0 ```