-
Notifications
You must be signed in to change notification settings - Fork 0
java.lang.IllegalArgumentException: Please set your project ID. A valid Firebase project ID is required to communicate with Firebase server APIs: It identifies your project with Google. #10
Description
Hi App Metrica Team,
I experience this exception with installed push SDK on an android device (Xiaomi Redmi Note 7).
AndroidJavaException: java.lang.IllegalArgumentException: Please set your project ID. A valid Firebase project ID is required to communicate with Firebase server APIs: It identifies your project with Google. java.lang.IllegalArgumentException: Please set your project ID. A valid Firebase project ID is required to communicate with Firebase server APIs: It identifies your project with Google. com.google.android.gms.common.internal.Preconditions.checkNotEmpty(Unknown Source:8) com.google.firebase.iid.FirebaseInstanceId.zza(com.google.firebase:firebase-iid@@20.1.7:52) com.google.firebase.iid.FirebaseInstanceId.getInstance(com.google.firebase:firebase-iid@@20.1.7:2) com.yandex.metrica.push.impl.ag.a(SourceFile:49) com.yandex.metrica.push.impl.b.a(SourceFile:83) com.yandex.metrica.push.YandexMetricaPush.init(SourceFile:139) com.unity3d.player.UnityPlayer.nativeRender(Native Method) com.unity3d.player.UnityPlayer.access$300(Unknown Source:0) com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95) android.os.Handler.dispatchMessage(Handler.java:103) android.os.Looper.loop(Looper.java:224) com.unity3d.player.UnityPlayer$e.run(Unknown Source:20) UnityEngine.AndroidJNISafe.CheckException () (at /Users/bokken/buildslave/unity/build/Modules/AndroidJNI/AndroidJNISafe.cs:24) UnityEngine.AndroidJNISafe.CallStaticVoidMethod (System.IntPtr clazz, System.IntPtr methodID, UnityEngine.jvalue[] args) (at /Users/bokken/buildslave/unity/build/Modules/AndroidJNI/AndroidJNISafe.cs:217) UnityEngine.AndroidJavaObject._CallStatic (System.String methodName, System.Object[] args) (at /Users/bokken/buildslave/unity/build/Modules/AndroidJNI/AndroidJava.cs:591) UnityEngine.AndroidJavaObject.CallStatic (System.String methodName, System.Object[] args) (at /Users/bokken/buildslave/unity/build/Modules/AndroidJNI/AndroidJava.cs:252) YandexMetricaPushAndroid.Initialize () (at E:/UnityProjects/UnityTestProjects_7/NewEraTestProject_2/Assets/AppMetricaPush/YandexAppMetricaPushAndroid.cs:36) AppMetricaPush.Start () (at E:/UnityProjects/UnityTestProjects_7/NewEraTestProject_2/Assets/AppMetricaPush/AppMetricaPush.cs:49)
--
Following are the steps I have followed:
Note: My project contains Firebase App, Cloud, Storage, Authentication, Cloud Messaging, Real-Time database, and External dependency manager packages.
1- I followed the official tutorial and integrate App Metrica and App Metrica SDK into the project.
2- When I build the app for the android platform, I got duplicate classes issue. Upon examing, I find out that the App Metrica push plugin has some .aar files which are also present in firebase SDK. So I delete all the files in the App Metrica push plugin except "appmetrica-push-plugin" & "mobmetricapushlib-1.1.0" and then build the app.
3- Though the app was build but when I try to test on android, I got the "java.lang.IllegalStateException: FirebaseApp name [DEFAULT] already exists!". So as mentioned in this link: "#8", I change the "ymp_firebase_app_id" instead of "ymp_firebase_default_app_id" and "ymp_gcm_sender_id" instead of "ymp_gcm_default_sender_id" in AndroidManifest.xml.
4- After doing this step, I am now getting this error "java.lang.IllegalArgumentException: Please set your project ID. A valid Firebase project ID is required to communicate with Firebase server APIs: It identifies your project with Google.".
I have tried my best to check every android manifest file to see if anywhere project or app id is wrong but all are correct. I have checked in "google-services" file which is under plugins/android/firebase/res/values but app id are correct there too.
So after that I test the app metrica push sdk without having any firebase related files in project and it works.
Thus the issue I understand is that app metrica push sdk has conflicts with firebase app sdk.
Can you please guide me, what can be the possible solutions?
Thanks in Advance