Android Question Problem with FirebaseAuth

musaso

Active Member
Licensed User
Longtime User
When using FirebaseAuth
B4X:
auth.Initialize ("Auth")

does not raise the event
B4X:
Sub Auth_SignedIn (User As FirebaseUser)

The log
B4X:
onAuthStateChanged: com.google.firebase.auth.internal.zzl@1ad41a62
and nothing more
 

musaso

Active Member
Licensed User
Longtime User
I put logs filtered and unfiltered.
 

Attachments

  • filtered log.txt
    209 bytes · Views: 220
  • unfiltered log.zip
    31.3 KB · Views: 249
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
java.lang.ClassNotFoundException: com.google.firebase.storage.StorageRegistrar
is the error.

Class com.google.firebase.storage.StorageRegistrar is not an found.
java.lang.ClassNotFoundException: com.google.firebase.storage.StorageRegistrar
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:308)
at java.lang.Class.forName(Class.java:272)
at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-common@@17.1.0:78)
at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-common@@17.1.0:71)
at com.google.firebase.FirebaseApp.<init>(com.google.firebase:firebase-common@@17.1.0:411)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.1.0:306)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.1.0:273)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@17.1.0:257)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@17.1.0:53)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1714)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1683)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@17.1.0:47)
at android.app.ActivityThread.installProvider(ActivityThread.java:4962)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4557)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4497)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5219)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.storage.StorageRegistrar" on path: DexPathList[[zip file "/data/app/es.nuevo.com-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 25 more
Suppressed: java.lang.ClassNotFoundException: com.google.firebase.storage.StorageRegistrar
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 26 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

Problem is your manifest content.

Created a new Firebase project, with a new package name,
created a new b4a project but I have the same result

Upload the new project.
 
Last edited:
Upvote 0

musaso

Active Member
Licensed User
Longtime User
Mi manifest:
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
SetApplicationAttribute(android:theme, "@style/Theme.AppCompat")

CreateResourceFromFile(Macro, FirebaseFirestore.Firebase)
CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)

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.storage.StorageRegistrar"
                android:value="com.google.firebase.components.ComponentRegistrar" />

            <meta-data android:name="com.google.firebase.components:com.google.firebase.firestore.FirestoreRegistrar"
            android:value="com.google.firebase.components.ComponentRegistrar"/>

        </service>
)
 

Attachments

  • FirebaseNuevo.zip
    9.5 KB · Views: 245
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
If you want to add another firebasecomponent (here firestore) you need to add a complete set of
ComponentDiscoveryService together with the new needed firebase registrar.

The new entry replaces the already added discoveryservice which comes from the firebaseintegration tutorial.

It is needed for ex for Firestore, for realtimedatabase...
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Mi manifest:
you manifest contains code for firestore but no firestore library added to the project.
you manifest contains code for FirebaseStorage but no FirebaseStorage library added to the project.
the google-services.json is missing
 
Upvote 0
Top