I am doing a flutter codelab but i follow the steps and when i want to run the app an error appears and prevents the app from running, this is the error:
../../AppData/Local/Pub/Cache/hosted/pub.dev/firebase_ui_auth-1.13.1/lib/src/screens/profile_screen.dart:826:18: Error: Property ’emailVerified’ cannot be accessed on ‘User?’ because it is potentially null.

  • ‘User’ is from ‘package:firebase_auth/firebase_auth.dart’ (‘../../AppData/Local/Pub/Cache/hosted/pub.dev/firebase_auth-4.19.0/lib/firebase_auth.dart’).
    Try accessing using ?. instead.
    if (user.emailVerified) …[
    ^^^^^^^^^^^^^
    ../../AppData/Local/Pub/Cache/hosted/pub.dev/firebase_ui_auth-1.13.1/lib/src/screens/profile_screen.dart:829:24: Error: Property ’emailVerified’ cannot be accessed on ‘User?’ because it is potentially null.
  • ‘User’ is from ‘package:firebase_auth/firebase_auth.dart’ (‘../../AppData/Local/Pub/Cache/hosted/pub.dev/firebase_auth-4.19.0/lib/firebase_auth.dart’).
    Try accessing using ?. instead.
    if (user.emailVerified) {
    ^^^^^^^^^^^^^
    Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:compileFlutterBuildDebug’.

Process ‘command ‘C:Usersflopezflutterflutter_windows_3.19.3-stableflutterbinflutter.bat” finished with non-zero exit value 1

  • Try:

Run with –stacktrace option to get the stack trace.
Run with –info or –debug option to get more log output.
Run with –scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 38s
Error: Gradle task assembleDebug failed with exit code 1

At first I changed the versions of the dependencies but that was not the solution, I copied the code from the repository of that step but it did not work for me either so I dnt know what I have to do. If someone knows how to help me answer this please

New contributor

user24002536 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.