Hi everyone, and welcome back.
Today, we're recording this lesson to make sure that we have unique application ID
for our application so that we can upload it to Google Play Store later.
Right now, if you'd wanted to find what your application ID is.
You're going to go to Android folder and then you're going to click on app.
And inside here you're going to find build.gradle file.
And if you go in there, you're going to see that our application ID is com.donationapp
Now, if you go to the link that was
provided in the article above this lesson, you're going to find that com.donationapp already exists
and that is why we're going to create something new and make sure that our
application can work as it did before with the new name.
The name that I'm going to choose that is
going to be unavailable for you later since I'm going to create an application
with that is going to be altrudonationappvache.
If I click on Enter here, you're going to see that this URL is not
found on the server, which means that this Identifier is available.
Now, once I use it,
you won't be able to use it yourself, so make sure that you come up
with something of your own and use that application ID.
Now, the first things first is that we want to make sure that our application is
not going to break after we make these changes and
our Firebase setup that mainly is
connected to Firebase using the google services.json file here
is connected to the application using our
application ID, which means that we have to generate a new one.
In your Firebase console, the URL is this here.
You can just go to your console and create a new project.
Let's name this project, altrudonationappvache.
Let's continue with this, and I'm going to click on Continue here as well.
My selected account will be the default account for Firebase.
I'm going to click on Create this project and wait for this to complete.
Once this is completed, please come back to the video and we're
going to go through the next steps together.
Great. The new project is ready,
so I'm going to click on Continue and I'm going to be taken to this page.
Here, I want to connect an application to get started, right?
Unfortunately,
since we're running on Windows, as you know, you don't have access to iOS setup.
If you'd like to set up iOS with your Firebase
project as well, please make sure that you have macOS handy.
Otherwise, you're not going to be able to complete it.
If you do have MacOS, then just discard this video.
Don't even watch it.
Grab your macOS computer and go
to the videos in this section that are dedicated to MacOS, and you're going to be
able to set up automated deployment system both for iOS and Android.
But in this video and in the upcoming
videos for Windows, we're only going to be taking care of Android.
Let's just click on Android here and what
we want to do is generate a new name for which we're going to type in here com.altrudonateappvache.
I'm going to register this application and
then once this is registered, I'm going to download the google services.json file.
Once this is downloaded, I'm going to make sure that I open my folder.
I will actually rename it.
I don't need this one.
I'm going to get rid of it and I'm going to rename this one.
Great.
Then I'm going to place this inside the app folder.
A file like this already exists.
I'm just going to say, Yes, replace this one.
Great.
Now that that's done, I'm going to click on Next.
We're not going to follow any of these
items, and I'm just going to click on Continue.
Here we are back to our console.
Now we also need to make sure that our authentication is set up.
I'm just going to go here and I'm going to click on Get started.
I'm going to click on Email and password, and I'm going to enable it.
I'm going to save this.
Now if I click on Users, you're going to see that no users are registered.
Great.
Now that this is done and Google services.json file is set up correctly,
what we need to do is make sure that every instance of ,com.donationapp,
our previous name is changed to our new name.
So for that, please go to the build.gradle
file inside the app folder of Android and just scroll down.
And here you're going to see com.donationapp.
We're going to replace this and we're going to say that this is now named
com.altrudonateappvache
I'm going to copy this and I'm going to paste it here.
I think this was the only two places where
we were referencing this name inside this file.
I'm going to click on Control F real quick and I'm going to type in com.donationapp
here I see that there are no results,
so there's nothing else to be changed in this file.
Now, I do know of some other places where
we should change this, so just follow me here.
We have to go to the Android folder again
and then app, and then inside there we're going to find source folder.
And inside the debug, Java, you're going to see a folder com
and then you're going to see a new folder donationapp.
We need to change this donationapp name here.
I'm going to rename this folder and I'm
going to name it as altrudonateappvache.
I'm going to click on Enter and now this is going to be my file name.
I'm just quickly going to open this Android manifest.xml
file and make sure that there's no com.donationapp
mentioned here and I still get no
results in my editor, so there is nothing to be edited here.
Then I'm going to open up the main folder here and go to Java again.
Here I see the donation app pop up again.
Let's rename this folder again and name it as altrudonateappvache.
I'm going to click on Enter and I'm going to go into mainactivity.java file.
Here I do see that there is one instance of this name.
I'm going to make sure that I get rid of this name and I input a new name.
The new name is going to be com.altrudonateappvache
I'm going to put semicolon here and save this file.
I'm going to do the same in mainapplication.
Java file.
Here I have the package name, again, as com.donationapp.
I'm going to select this and
make sure that I paste in a new name and put a semicolon there.
I'm going to save this and I'm going to check if there's any other instances
and there is no other instances here either.
Great. After that, let's go to Android manifest
file and I don't see any instances here either.
Then we're going to close the main folder and the debug folder.
We edited everything that we needed to there.
Then I'm going to open the release one and I do see the com.donationapp folder here as well.
I'm going to rename it and I'm going to name it as altrudonateappvache again.
Here is my folder name right now and I'm going to go to reacnativeflipper.java
and I'm going to make sure that this is replaced with the new name as well.
File, and I'm going to save it. Great.
We have edited the folder names along with the reacnativeflipper.Java files.
We edited mainapplication.java,
mainactivity.java files.
I think we are done with everything that we needed to change here.
Technically, I think that we do have
a global search here, so I could search for com.donationapp
and see if it appears anywhere else.
It does seem like that we have it
in the Google services info plist, which is inside the iOS folder.
We're not going to change anything inside iOS folders.
This is not something that's applicable, but there is one more file that we need
to edit, and it is particularly inside android/app/source/debug/java/com folder
altrudonateappvache, and ReactNativeFlipper.java file.
It's inside the debug folder, so make sure to go inside the
reactnativeflipper.java file, inside the debug folder.
This is the path again.
We're going to change this package
and we're going to reference a new name that we have.
I'm going to paste it here, put a semicolon there, and save this.
Wait, now that we are sure
that everything's been edited and we missed out on nothing,
what we want to do is make sure that our application works the way it used to work.
For that, please make sure that you open up your command-line tools.
I'm actually going to close everything.
It's better to start from scratch.
Open up your terminal and then go to the desktop and then go to donation app
and then go to Android file and here do gradlew clean.
This is going to clean all of the caches
inside your Android folder, which will make you able to build application
from scratch without any caches messing with you.
So wait for this step to complete and come
back to the video once you're done with this.
Great, it's been done.
Now let's get out of this folder of Android and run
npx react-native run android
inside the root of our project and wait for it to complete.
You're going to see the emulator openup,
you're going to see the Metro Bundler open up.
So once this is built, we should be able to log in to our
application again if we register because currently we have no users.
So we're going to go through the registration process again.
Let's just wait for this build to be completed.
Great. We can now see the application splash
screen that we've been working on together.
So our application is opening up and it has rendered.
Now, what we need to do is make sure that we create an account.
I'm just going to click on Don't have an account.
I'm going to enter my full name and then I'm going to enter my e-mail address
and I'm going to enter my password and I'm going to click on registration.
Here, if I come back
and I refresh this page, I'm going to see my Identifier appear here.
Now I can use this to log in.
I'm going to click on Login and
we're going to see that this has worked just fine.
Our naming and Firebase setup changes have worked successfully.
For the next video,
we're all ready to upload our application on Google Play Store.