WEBVTT

00:00.080 --> 00:00.760
Welcome back.

00:00.760 --> 00:03.360
When running the application we have this error.

00:03.400 --> 00:08.760
Hilt activity must be attached to hilt Android app annotation application.

00:08.960 --> 00:14.320
Did you forget to specify your application's class name in your manifest?

00:14.360 --> 00:22.960
Yes, we need to create a class that extends from application and we need to specify the name attribute

00:22.960 --> 00:24.400
in our manifest.

00:24.480 --> 00:33.400
So open this package and inside the main package create a new Kotlin class named as my app.

00:33.560 --> 00:45.440
This class extends from application and would be annotated with hilt Android app simply here I'm telling

00:45.560 --> 00:54.280
hilt hey hilt, please generate all the code that is required for dependency injection to work with

00:54.720 --> 00:56.280
this application.

00:56.280 --> 01:04.280
When you annotate your application class with Android hilt annotation, hilt generates a base class

01:04.300 --> 01:12.220
That starts up the dependency injection container and connects hilt to the Android life cycle.

01:12.420 --> 01:21.860
Your app will have a singleton component that lives as long as the app process hilt can now inject dependencies

01:22.060 --> 01:31.780
anywhere in your app activities fragment view, models, services and etc. without hilt Android application

01:31.820 --> 01:40.460
hilt won't work and won't know where to start and you'll get errors as I show you before.

01:40.620 --> 01:43.220
Okay, so this is a very important note.

01:43.220 --> 01:53.380
Please write it down without hilt Android app hilt won't abe it won't be able and won't know where to

01:53.700 --> 01:54.540
start.

01:54.580 --> 02:04.620
The second step is to not to mention it inside Androidmanifest and modify and specify the name attribute

02:04.620 --> 02:07.900
inside the application, setting it to this app.

02:08.100 --> 02:13.190
So I'm referring the name attribute for this application as my app here.

02:13.190 --> 02:18.590
That is the class that extends from application and annotate it with hilt Android app.

02:18.790 --> 02:19.990
Let's run again.

02:20.030 --> 02:20.910
Here we go.

02:21.190 --> 02:24.790
Our application starts and no errors.

02:25.150 --> 02:27.950
Now let's search for tag here.

02:28.190 --> 02:32.710
And we notice that marker added successfully.

02:32.750 --> 02:35.270
Open Firebase console.

02:35.430 --> 02:38.630
Go to Uber Clone project.

02:38.790 --> 02:42.310
Select from here Firestore database.

02:42.310 --> 02:43.870
And here we go.

02:44.030 --> 02:45.830
Congratulations guys.

02:45.830 --> 02:48.790
We created a collection called markers.

02:48.830 --> 02:52.870
We added the first document with ID San Francisco.

02:53.070 --> 02:59.150
And inside this document we have the fields latitude and longitude.

02:59.430 --> 03:08.190
So our application is working fine following the MVVM architecture and clean architecture and design

03:08.190 --> 03:08.990
patterns.
