Firebase / Cloud Messaging - android

I've got some issues regarding the integration of Firebase in my Android Unity app.
I created a project on firebase with my Unity Bundle Identifier.
In authentification I enabled email and anonymous (I just exactly follow all the steps provided by Firebase in their tuto).
On Unity side I got the last firebase plugin.
First of all I started to have some manifest issues:
CommandInvokationFailure: Unable to merge android manifests. Error:
[Temp\StagingArea\AndroidManifest-main.xml,
C:\Users\Public\Documents\Unity
Projects\WheelRotation\Temp\StagingArea\android-libraries\com.google.firebase.firebase-measurement-connector-impl-16.0.0\AndroidManifest.xml:10]
Trying to merge incompatible
/manifest/application/service[#name=com.google.firebase.components.ComponentDiscoveryService]
element
To solve this issues I just updated my manifest on Unity side to be able to compile the app and launch it on my android phone.
I succeeded to do that but when looking at the Firebase/Authentification/ Users, my Android app didn't appear.
Furthermore, when Using firebase cloud messaging interface, I can't succeed to send message (I can select the app, then click on Send but when I check my message no message was sent (the Sent column stays on 0) and obviously I don't receive the message on my android phone.
Thx in advance for your precious help.
Regards.
I'm using Unity Version: 5.4.1p2 (really need this version for specific plugins) all all other plugin are uptodate (JDK and Android sdk)

I recently discovered a bug in the newer Firebase version with Unity which relates to the ComponentDiscovery Service. Since I don't know how to mark as possible duplicate, I repost my solution here, which may help you:
The solution behind this seems to be the package name variable, which
unity won't replace by the actual package name in the latest builds.
https://forum.unity.com/threads/android-gradle-cannot-read-packagename-from-gradleout-src-main-androidmanifest-xml.524587/
proposes a temporary fix, by renaming the package="${applicationId}"
variable inside the "\Assets\Plugins\Android\AndroidManifest.xml" on
line 4 with the actual package name e.g :
package="com.MyCompany.MyGame"

Related

ERROR: FirebasePerformancePlugin must only be used with Android application projects. can't in Library?

I have built a project with all Firebase features including Firebase Performance Plugin. Now we are trying to make it as Library, While trying to convert from Application to Library we are facing an issue from Firebase as
ERROR: FirebasePerformancePlugin must only be used with Android application projects. Need to apply the 'com.android.application' plugin with this plugin.
May I know the reason why I am facing this issue. I am excepting a quick reply from the Team.
Thanks in advance
As the error suggests, Firebase Performance Monitoring is not supported for libraries, only apps. You currently can't use the product to collect performance information for you library if it gets integrated into other apps. You can only use it for monitor the behavior of a specific app that's added to your Firebase project.
If this is not what you want, you can file a feature request with Firebase support. Though, for this request, I suspect nothing will happen in the short term.

How to resolve "Can't Update the app(Error Code : 901)" error?

I'm migrating one of my live applications from Native to Xamarin. I have successfully done that and now I'm trying to release the same on Google Play Store.
I have generated a release build for the same in Xamarin android. Following are the scenarios which will describe the issue I'm facing -
Fresh Install - As I have a release apk for my application, I'm able to install it on my device and it's working smoothly.
Update Scenario - As I have mentioned earlier that the application is already live which was developed on Native Android, I have installed the live version of the same and tried updating the app using the latest release build that I have generated from Xamarin. In this case I'm getting the issue.
Attached a screenshot for the reference.
What I have tried so far to resolve the issue -
As there are multiple questions related to this issue, I have tried following things to get rid of this issue -
Clear data and Clear Cache of Google Play Store application.
Checked the Signing keys are same as before.
Checked the package name is same as before.
Removed the Google account and added again as per the suggestions.
I need to resolve this error soon, so I can't use the Fresh Install technique as an option.
I am able to identify the issue and fortunate that it got resolved. Sharing it here so if anyone gets stuck for the same issue then they can refer this.
Identified Issue - The issue was quite silly as the version code wasn't getting updated from the UI of Android Manifest even if I was changing the values. That might be the glitch in Xamarin or Visual Studio (for Xamarin).
What I did to resolve this - I manually deleted the declaration of Version Code and other values which weren't changing from AndroidManifest.xml then from the UI section of the Manifest I upgraded the Version Code and build the solution for release. That's how things got resolved at my end.
Hope this helps. Thanks.

Implement FCM Using eclipse in Android

I would like to integrate FCM push messaging service using eclipse. Somehow I'm not able to use Android studio. I found plenty of answers but all these are not solid answer. Mostly answered with "Use Android Studio" that's not appropriate answer for question.
see related:
Not getting notification using Firebase in Eclipse
Unable to find obfuscated Firebase class in Eclipse
How can I use Firebase cloud message in an eclipse project?
Currently I managed those two jar from firebase (iid & messaging) inside libs but no idea how to config "google-services.json" inside eclipse.
I raise this question cause there is not solid and complete answer for this. So please don't mark this duplicate humble request. I know this is big challenge for who stopped using eclipse since Android Studio arrived.

getToken() failed. Status BAD_AUTHENTICATION error

I've found the following error when running my android application in android studio. app couldn't get installed on my device because of this error. Didn't find the solution :(
please help
Auth: [GoogleAccountDataServiceImpl] getToken() failed.
Status BAD_AUTHENTICATION,
Account: ,
App:com.android.vending,
Service: androidmarket com.google.android.gms.auth.be.account.b.d: Long live credential not
available.
I had the same issue what helped me was that I had wrong credentials in my google-services.json file and after getting a new file my problem was fixed.
in the process of resolving this issue I also updated my google play services but I do not think this is necessary .
I got this error when tried to install app directly from Android Studio.
It was due to certificate mismatch, since I used release certificate for setting up the app in Play Console, while Android Studio signs the app with debug certificate by default.
Installing app via adb resolved the error.
https://developers.google.com/games/services/android/quickstart#step_4_test_your_game
Make sure to run an APK that you exported and signed with a
certificate that matches one of the certificates you used during the
application setup in Google Play Console.
I have the same problem some days ago. I just compile my whole code in a new project and Problem Solved!!.
Don't know what was the real problem. There is an issue filed here, with no solution.
There are several reasons you can get that message:
The account you are trying to log on with needs to be re-authenticated on the phone (try a different account)
The gms:play-services version is out of date (needs to be 15+ as of Jan 2021)
Your app fingerprint is not the right one. You need one for dev builds, different one for prod -- which is different based on how you sign (do you have the final publish key, or does Play store re-sign with the final publish key?)
Follow the Google tutorial and get their stand-alone project, it should take 20 min, and check your setup there. If you are running it with all the right accounts it should work. Then go back to your app.
https://developers.google.com/identity/sign-in/android/start
I updated Google Play Services on my phone and stopped receiving the same error. I am importing com.google.android.gms:play-services-cast:9.6.1 and analytics:9.6.1. Not sure if the version running on the device was too low but problem is now resolved but not sure how to prevent this error for users running older versions of Google Play Services.
Tested the other solutions but nothing worked. Rebooted the device and error was gone.
If you using firebase server, As per the firebase updation if you give phone number authentication put your country code before contact number it is mendetory.
example - +91 9999998888
This happened to me, auth errors in ADB, among them:
android Warn Auth [GoogleAuthUtil] GoogleAuthUtil
Because, like mentioned above, I had a debug build running on phone previously. So I fully uninstalled the app on my phone, and the next [Build and Run] ran successfully.
Please try the App with new google credentials or even try creating the whole peoject on console og google play services if you have used it .
In my case it was a dependency version problem. I had to update the auth dependency for firebase to the latest one:
implementation 'com.google.firebase:firebase-auth:17.0.0'
Here is my take towards this problem:
You may be using a single email to try and log in to google. It may be possible you might have changed the password of the particular email in the recent past. Make sure u remove your google-email from your phone/emulator. When u re-run your application, you will be asked to enter both email and password credentials.
Check if your credentials.json is still valid. Sometimes its possible that your client ID might be removed/corrupted if you have not used your android application for a long time. Make a new one and dont forget to copy-paste it in app folder of Android Project view.
PS: I am new to Android Studio and writing answers on stackoverflow in general. If you are reading this comment please let me know what improvements i can make while answering questions in the future.
I copied and ran the code in a different project that had priorly worked on simple DB operations of Firebase. Probably it already had the authentication files in place so launching the app was solved there
Mostly your token has gone bad. And needs a new one.
Go to project database > settings > General > download Json file and replace it with the one in the local project directory.
I fixed this problem with updating fingerprints (sha1 or sha256)
My problem was with Microsoft App Center.
We recently set our pipelines to send aab files to App Center, instead of apk files.
It seems that our bundle was resigned by App Center with some generated keystore. That's how App Center distributed apk files, even though our pipeline uploaded aab files.
In other words: even though our pipeline is using our own keystore to sign the aab bundle, in order to distribute through the App Center, after sending the aab to App Center, the App Center is creating universal apks with another generated keystore.
After rolling back our pipeline to send apk instead of aab, Google SignIn on our react-native app with firebase was working again.
"When you distribute Android Application Bundle (AAB), App Center generates a universal APK, signs it with a generated signing key, and distributes it to a device."
Source: https://learn.microsoft.com/en-us/appcenter/distribution/uploading

Fabric plugin cannot login via Android Studio

I am using Android Studio 1.5, Fabric Plugin 2.3.1. What possible reasons would Fabric not allow me to login?
The whole process is completely knackered. Any Fabric link I visit including the organization settings link located here directs me to the on-boarding link where all I can do is view instructions on how to download the plugin. I have installed the plugin, login and I see the list of Fabric components for about 2 seconds before it brings me back to the login screen with no message at all.
The credentials are fine (incorrect credentials give me an orange message saying so). I have tried it with 3 different accounts.
So now I am in a situation where I have 3 accounts, all of which only allow me to view instructions on how to download the plugin, and the plugin will not let me get further than the login screen. I could do this manually but cannot access the organization settings screen either. Any ideas?
EDIT: This is the closest similar issue I could find on their forums but it relates to a Mac (I'm on Windows 10, Java version jdk1.7.0_79)
What fixed it for me was adding the authKey to the application block in the main manifest.
NOTE: at the time of this issue, I am using Android Studio 2.0 Beta 6. We believe that there might be an issue with the Fabric plugin and this version.
To see what's happening to the Fabric plugin, I had to open the Console app and view the logs in realtime. Sure enough, it showed that was authenticated with my credentials, AND it passed back the reason I was being sent right back to the login: Missing authkey in the application block.
So I copied an authkey node from a previous project and added it to the manifest and bingo - it took me to the screen to install Crashlytics.
The thing is, I could have sworn that the Plugin was supposed to GIVE me the authkey after it installed Crashlytics, so I was a bit puzzled as to why this worked. But it did.
Again, this is with Android Studio 2.0 Beta6 so it might be only related to that. But using the Console to diagnose the issue with the Fabric Plugin is the take away here.
Download the fabric plugin for android studio via jetbrains.com using your prefered browser(i.e mozilla,chrome etc).
after your file get downloaded(not via andriod studio), open your AndroiStudio, goto --file>>settings>>plugin>>install plugin from disk, give the .jar file which you have downloaded, then restart studio

Categories

Resources