Welcome back.
When running the application we have this error.
Hilt activity must be attached to hilt Android app annotation application.
Did you forget to specify your application's class name in your manifest?
Yes, we need to create a class that extends from application and we need to specify the name attribute
in our manifest.
So open this package and inside the main package create a new Kotlin class named as my app.
This class extends from application and would be annotated with hilt Android app simply here I'm telling
hilt hey hilt, please generate all the code that is required for dependency injection to work with
this application.
When you annotate your application class with Android hilt annotation, hilt generates a base class
That starts up the dependency injection container and connects hilt to the Android life cycle.
Your app will have a singleton component that lives as long as the app process hilt can now inject dependencies
anywhere in your app activities fragment view, models, services and etc. without hilt Android application
hilt won't work and won't know where to start and you'll get errors as I show you before.
Okay, so this is a very important note.
Please write it down without hilt Android app hilt won't abe it won't be able and won't know where to
start.
The second step is to not to mention it inside Androidmanifest and modify and specify the name attribute
inside the application, setting it to this app.
So I'm referring the name attribute for this application as my app here.
That is the class that extends from application and annotate it with hilt Android app.
Let's run again.
Here we go.
Our application starts and no errors.
Now let's search for tag here.
And we notice that marker added successfully.
Open Firebase console.
Go to Uber Clone project.
Select from here Firestore database.
And here we go.
Congratulations guys.
We created a collection called markers.
We added the first document with ID San Francisco.
And inside this document we have the fields latitude and longitude.
So our application is working fine following the MVVM architecture and clean architecture and design
patterns.