googleads-mobile-flutter: WriteBuffer buffer error

Plugin Version

Steps to Reproduce

  1. Run flutter create bug.
  2. Update the files as follows: …

Expected results:

Actual results:

Logs

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 29

Most upvoted comments

Add this line

import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer;

Running Smoothly Now

Looks like this is only happening on 3.0. Upgrading to 3.3 fixes this.

I also got this problem user_messaging_codec.dart:27:19: Error: ‘WriteBuffer’ isn’t a type and Error: ‘ReadBuffer’ isn’t a type. Cause for google mobile ads plugin.

solution goto this location of your drive:- C:\src\flutter.pub-cache\hosted\pub.dartlang.org\google_mobile_ads-2.3.0\lib\src\ump\user_messaging_codec.dart

and edit googleads user_messaging_codec.dart and add :-- “import ‘package:flutter/foundation.dart’ show ReadBuffer, WriteBuffer;” this line to import the read and write buffer then save the file using ctrl+s and ctrl+s+k.

then do :- 1) flutter clean 2) flutter pub get

it solve my problem, this answer is not found in internet . Follow our youtube channel THECOMPUTERMIND for more. link:-https://www.youtube.com/@thecomputermind1

Not sure why this issue is closed, I reproduce in my project too. Any news?

##my troubleshooting steps were as follows:

  1. Check Android studio and flutter update. Tried to run my app but didn’t success.
  2. Completly Disable/Removed google ads and comment out ads section. Tried to run again. It was successful.
  3. Finally, reimplement google admob.

My Assumption. I was working on my old project in Android studio flutter project. A pop up message displayed for an update and asked to backup my project otherwise it will overwrite. I didn’t check properly and just ignore the message and simply click on update. After that i face this same issue.

Found changes in project after update.

  1. Admob setting missing in Android activity file.
  2. App name changed to default com.example.project_name
  3. App icons replaced by default flutter icons.

So, I followed my troubleshooting steps. It took me atleast 1hour trying this & that here & there. Finally decided to remove admob and found 1 by 1.

##All the best. 👍

Anyone still facing this, you have two options:

  1. Update flutter, clean, and rebuild.
  2. Specify a static version. (e.g. google_mobile_ads: 2.1.0, note that there’s no carrot ^)