I am trying to follow the instructions on migrating my app from GCM to the Firebase system, and according to this link, I will have to download the new google-services.json file. However, I have already a previous google-services.json file that was generated when I enabled other APIs (including the GCM).
So my question is how am I supposed to include these two files in my app folder when they have the exact same name? Or am I supposed to paste the json code from the last file to my original one?
Please note that this is not about different flavors, as both google-services.json files refer to the same app configuration.
Thanks!
The google-services.json file is be common across all the firebase components.
If you already downloaded the file from your firebase console then you are good. (every new download should return the same file, provided that you are using the same Firebase project)
If your previous file was generated before the firebase announce then it's worth to migrate your project and re download the file.
Related
I get the error Failed to read Firebase options from the app's resources. Either make sure google-services.json is included in your build or specify options explicitly.
When building the unity game to android, even though it works in the editor.
I have tried all the solutions of previous questions. Notably, I don't have a mainTemplate.gradle file, and inside /Plugins/Android I don't have a firebase folder. I am using the .net framework, and I enabled arm64. I also have the googleservices.json both in the assets folder and streamingassets folder. Are there any other solutions? Thanks!
When you want to build to an android project, you need to have a keystore file and I didn't have one. Here is a link to explain how to create the keystore file:
https://github.com/firebase/quickstart-unity/tree/master/database/testapp
New to android development. When we distribute the .apk file, can the receiver extract the google-services.json and use our database or authentication database.
I looked
I have apk file, Is it possible to get android studio project from apk?
and Is google-services.json confidential?
and Is it possible to decompile an Android .apk file?
but don't directly relate
I tried to extract an apk of mine which has google-services.json file and I couldn't find the google-services.json file in extracted folder .
Edit : Here is more info I found
The google-services plugin has two main functions:
1 - Process the google-services.json file and produce Android resources that can be used in your application's code. See Adding the
JSON File more information.
2 - Add dependencies for basic libraries required for the services you have enabled. This step requires that the apply plugin:
'com.google.gms.google-services' line be at the bottom of your
app/build.gradle file so that no dependency collisions are introduced.
You can see the result of this step by running ./gradlew
:app:dependencies.
This means that the google-services.json file will be converted to android resources by google-services plugin during build process .
You can find how google-services.json works over here
can the receiver extract the google-services.json and use our database or authentication database.
Even if the receiver extracts credentials from apk , he cannot access database as the SHA-1 will be different .
I'm trying to use this alarm app on Android Studio - https://github.com/philliphsu/ClockPlus . However, gradle build is failing (error message below). Please let me know what needs to be fixed for this to work.
Error:/Users/***/Documents/Apps/ClockPlus-master/keystore.properties (No such file or directory). Let me know what exactly is this keystore.properties and is it possible to create this file as it's not available in the github repo files.
what exactly is this keystore.properties?
When you want to publish your app in the google play, you need to sign your app. When you create a signing configuration,Android Studio ,by default, adds your signing information in plain text to the module's build.gradle files. If you are working with a team or open-sourcing your code, you should move this sensitive information out of the build files so it is not easily accessible to others. To do this, you should create a separate properties file to store secure information and refer to that file in your build files. That file is the keystore properties file.
Read more about this
Is it possible to create this file as it's not available in the github
repo files?
Create a file named keystore.properties in the root directory of your project. This file should contain your signing information, as follows:
storePassword=myStorePassword
keyPassword=mykeyPassword
keyAlias=myKeyAlias
storeFile=myStoreFileLocation
If you do not have store password, key password etc. you should sign your app.
Read more about this
The whole information about this is in the Android Developer documentation, in the link I provided above.
I want to use Firebase push notifications, but I am running into a configuration conflict. I would like to support different packages. With Google Maps, for example, I can add multiple packages under one app. This is because of Flavors. If My app package is com.example, I may have multiple Flavors such as com.example.a, com.example.b. I want to add support for push notifications for all of these Flavors.
How do I add multiple package names on the Firebase console?
You dont need to create a seperate google-services.json file for each Flavour,
just add the app to the Firebase Project and redownload the generated google-services.json file.
when you add an app the to the firebase Project, it automatically update the google-services.json file with the Client info you have added, so all you need is to download and replace your old one.
Just create seperate google-services.json files for each package you have and put them in their respective src folders
For some reason I do not use Android Studio, I compile my apps using a remote server with apache ant so, Is there a way to add firebase analytics, messaging... as libraries?
Firebase is a set of aar (Android Archive) files. Android Studio gradle plugin will simplify the use of the aar files but you can manually configure the app to use the aars. To do so in addition to linking to the libraries you will need to manually merge the manifest from all aar files to your app manifest. That includes permissions, services, receivers, content providers etc. aar is simple zip file. You can open it with unzip (or any other tool that reads zip files) and see the AndroidManifest.xml. You will also need to merge all the resources (if any) for the aar files. The last step will be to add the google_app_id from the generated google-services.json file as string resource. All in all, this is not a trivial work but it is possible.