Android Question [Error] Firebase Analytics closes abruptly the app

Paolodc

Member
I don't know what is happened but firebase analytics doesn't work.
I've seen a different thread in which the issue is like this, however, I've not resolved it.
This is my Manifest Editor:
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="30"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.

#Region Firebase Resources
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
'CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
'CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)
#Region Components
AddApplicationText(
<service android:name="com.google.firebase.components.ComponentDiscoveryService" >
<meta-data
    android:name="com.google.firebase.components:com.google.firebase.analytics.connector.internal.AnalyticsConnectorRegistrar"
    android:value="com.google.firebase.components.ComponentRegistrar" />
<meta-data
    android:name="com.google.firebase.components:com.google.firebase.iid.Registrar"
    android:value="com.google.firebase.components.ComponentRegistrar" />
<meta-data
    android:name="com.google.firebase.components:com.google.firebase.auth.FirebaseAuthRegistrar"
    android:value="com.google.firebase.components.ComponentRegistrar" />
<meta-data
    android:name="com.google.firebase.components:com.google.firebase.database.DatabaseRegistrar"
    android:value="com.google.firebase.components.ComponentRegistrar"/>
</service>
)
#End Region
#Region Permissions
'AUTH WITH GOOGLE
'AddPermission (android.permission.VIBRATE)
'FIREBASE DATABASE
AddPermission(android.permission.INTERNET) ' Allows applications to open network sockets.
AddPermission(android.permission.ACCESS_NETWORK_STATE) ' Allows applications to access information about networks.
AddPermission(android.permission.FOREGROUND_SERVICE)
AddPermission(android.permission.WAKE_LOCK)
AddPermission(com.google.android.c2dm.permission.RECEIVE)
AddPermission(${applicationId}.permission.C2D_MESSAGE)
AddPermission(com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE)
#End Region
#End Region

And in my Main Mod
B4X:
 #AdditionalJar: com.google.android.gms:play-services-base
ule I've added :

How I can resolve it? Please!!
 

Paolodc

Member
Now this is my manifest:

B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="30"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)

CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
'CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)

But I've a new type error:

Logger connesso a: HUAWEI COL-L29
--------- beginning of crash
--------- beginning of system
--------- beginning of main
** Service (starter) Destroy (ignored)**
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
false
SignInWithGoogle called
** Activity (main) Resume **
onAuthStateChanged: com.google.firebase.auth.internal.zzn@38b59c5
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
SignInWithGoogle.ResultArrived
ResultArrived Error: Status{statusCode=DEVELOPER_ERROR, resolution=null}, null
** Activity (main) Resume **
 
Upvote 0

Paolodc

Member
I resolved it. The problem was the incorrect registered key.
So I create a new key a changed it both on my B4A project and Firebase project
Thanks for your answers.
 
Upvote 0
Top