flutter_google_ad_manager icon indicating copy to clipboard operation
flutter_google_ad_manager copied to clipboard

Experiencing poor app performance or stuttering animations in a long list view with images.

Open theneshofficial opened this issue 6 years ago • 11 comments

Hi, I'm facing poor app performance or stuttering animations in a long list view with big images when place ads in between the list. If I remove the ads the scrolling is smooth. Please advise.

theneshofficial avatar May 10 '19 01:05 theneshofficial

Hi @ko2ic you can wrap the platform channel code with new thread rather than using main threat. For example:

 @Override
 public void onMethodCall(MethodCall call, Result result) {
  if (call.method.equals("sleep")) {
   new Thread(new Runnable() {
    public void run() {
     try {
      Thread.sleep(10000);
     } catch (InterruptedException e) {
      e.printStackTrace();
     }
     result.success("Good morning!");
    }
   }).start();
  } else {
   result.notImplemented();
  }
 }

theneshofficial avatar Jun 17 '19 09:06 theneshofficial

Can confirm this is a big issue as it breaks the smooth behavior of an application. When scrolling through a ListView.builder which contains ads every nth item, the Choreographer complains: I/Choreographer( 7590): Skipped 33 frames! The application may be doing too much work on its main thread. At 60fps that is 550 milliseconds of frozen view during an animation.

GeertJohan avatar Jun 29 '19 12:06 GeertJohan

I've tried to add threading but it's not that simple. The PlatformView cannot be modified from a different thread than the one it was created from, so moving the hard word in the methodcall to a separate thread (not the main thread) breaks because the PlatformView needs the main thread.

I've placed some simple milsecond meassures and most of the time seems to be in the loadAd call. Which is odd because according to docs it is supposed to do it's work in a background thread. https://developers.google.com/android/reference/com/google/android/gms/ads/doubleclick/PublisherAdView#loadAd(com.google.android.gms.ads.doubleclick.PublisherAdRequest)

GeertJohan avatar Jun 29 '19 14:06 GeertJohan

I tried running on dev channel of flutter with v1.8.0, certainly it fixes the low performance issue but on plugin side the ads are not displaying the images. It just not showing any image, it's blank but onClick is working. Please update the plugin to support flutter v1.8.0. Thanks.

theneshofficial avatar Jul 02 '19 07:07 theneshofficial

@theneshofficial That sounds like a separate, but very important/breaking, issue. I think you should open a new issue for that, perhaps with a screenshot.

GeertJohan avatar Jul 02 '19 15:07 GeertJohan

I am also having this issue, is there any update on how to fix this?

nickJLm avatar Oct 31 '19 13:10 nickJLm

Did anyone found any solution to the poor performance issue? I also have a problem with stuttering scroll when implementing multiple banners.

pixelgroup-israel avatar Dec 10 '19 07:12 pixelgroup-israel

I could not find a solution to this problem, and as a result, this issue is stopping us from releasing an iOS application. The team I work for had to start making a native iOS application. I am hoping that this gets resolved.

nickJLm avatar Dec 10 '19 13:12 nickJLm

Is this plugin still updating? This bug is problematic, and stopping me from releasing an app to the stores. Can anyone come with a solution for this?

pixelgroup-israel avatar Jan 14 '20 06:01 pixelgroup-israel

Any updates on this please

BeshoyAdelHemaya avatar Apr 30 '20 01:04 BeshoyAdelHemaya

Does this plugin https://pub.dev/packages/pigeon from flutter team help to solve the issue? I guess might improve the communication between platform channels. Worth trying.

theneshofficial avatar Jun 18 '20 02:06 theneshofficial