0

I'm following this official Flutter tutorial

I wrote the same code as in the video tutorial, but when I added the AdListener inside AdState class, the Android Studio gave me an error: the AdListener isn't a type.

1 Answer 1

1

I followed your guide, indeed, there is no AdListener type, but I was able to solve this problem, change the version of the google_mobile_ads package to the following and it will help:

google_mobile_ads: ^0.11.0
6
  • with this version 0.11.0 android studio keep to show me the error but give me to add the google library, I add library and still getting the problem, please look at the picture: i.ibb.co/9HSFrh5/Sans-titre.jpg
    – Kalma Gaz
    Mar 30, 2022 at 23:37
  • So you didn’t click on the “Import” button, import the library and everything will work, maybe I didn’t understand you, in this case enter the command “flutter clean” into the console - re-download the packages, reinstall the application on the emulator, your IDE will rethink the connection and that’s it, it should work.
    – Legend5366
    Mar 31, 2022 at 7:12
  • i follow all the steps in your comment and i get the same error: AdListener isn't a type ibb.co/FXdwQdp one thing, i use android studio dophin | 2021.3.1 Canary 7
    – Kalma Gaz
    Mar 31, 2022 at 12:34
  • I'm using Visual Studio Code, but it doesn't matter, my advice is to find an up-to-date manual, because you had a problem with having a class, I found a solution, but you still have problems...
    – Legend5366
    Mar 31, 2022 at 17:20
  • i solved the problem by following this tutorial: youtube.com/watch?v=4mJQQmjnL3Q
    – Kalma Gaz
    Mar 31, 2022 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.