I am trying to use google_mobile_ads but It does not work.
The error is:
../../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/google_mobile_ads-3.0.0/lib/src/ump/user_messaging_codec.dart:27:19: Error: Type 'WriteBuffer' not found.
void writeValue(WriteBuffer buffer, dynamic value) {
^^^^^^^^^^^
../../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/google_mobile_ads-3.0.0/lib/src/ump/user_messaging_codec.dart:45:41: Error: Type 'ReadBuffer' not found.
dynamic readValueOfType(dynamic type, ReadBuffer buffer) {
^^^^^^^^^^
../../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/google_mobile_ads-3.0.0/lib/src/ump/user_messaging_codec.dart:27:19: Error: 'WriteBuffer' isn't a type.
void writeValue(WriteBuffer buffer, dynamic value) {
^^^^^^^^^^^
../../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/google_mobile_ads-3.0.0/lib/src/ump/user_messaging_codec.dart:45:41: Error: 'ReadBuffer' isn't a type.
dynamic readValueOfType(dynamic type, ReadBuffer buffer) {
I used the sample here: https://github.com/flutterguru1/source_code/blob/main/admob_interstitialAd/main.dart
I just want to show interstitial add when tap on the button. How can I fix it?
According to #668:
3.1.0
or aboveuser_messaging_codec.dart
inpub-cache
and add this import:import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer;