Coder Social home page Coder Social logo

firebase / quickstart-android Goto Github PK

View Code? Open in Web Editor NEW
8.7K 542.0 7.3K 31.84 MB

Firebase Quickstart Samples for Android

Home Page: https://firebase.google.com

License: Apache License 2.0

Java 53.88% HTML 0.78% Shell 0.36% JavaScript 0.90% Kotlin 43.55% Python 0.54%
android firebase

quickstart-android's Introduction

Firebase Quickstarts for Android

A collection of quickstart samples demonstrating the Firebase APIs on Android. For more information, see https://firebase.google.com.

Samples

You can open each of the following samples as an Android Studio project, and run them on a mobile device or a virtual device (AVD). When doing so you need to add each sample app you wish to try to a Firebase project on the Firebase console. You can add multiple sample apps to the same Firebase project. There's no need to create separate projects for each app.

To add a sample app to a Firebase project, use the applicationId value specified in the app/build.gradle file of the app as the Android package name. Download the generated google-services.json file, and copy it to the app/ directory of the sample you wish to run.

How to make contributions?

Please read and follow the steps in the CONTRIBUTING.md

Actions Status SAM Score

quickstart-android's People

Contributors

alihusnainarshad avatar ashwinraghav avatar dependabot[bot] avatar dpebot avatar edngulele avatar egilmorez avatar eldhosembabu avatar friederbluemle avatar fuadrafid avatar gkaldev avatar harshithdwivedi avatar hush-at-google avatar jakeouellette avatar kevinthecheung avatar kokoro-team avatar kroikie avatar leesin0222 avatar lsirac avatar marianiacob avatar meghab avatar morganchen12 avatar nikit19 avatar revan avatar samtstern avatar schmidt-sebastian avatar thatfiredev avatar ulukaya avatar xinyuez avatar yanzm avatar zayna-shahzad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quickstart-android's Issues

Failed to initialize crash reporting RuntimeException

Using Play Services 9.0.83 on a Nexus 5X I received the following stack trace when a crash occurred in my app.

E/DynamiteModule: Failed to load module descriptor class: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.android.gms.crash.ModuleDescriptor" on path: DexPathList[[zip file "/data/app/REDACTED-2/base.apk"],nativeLibraryDirectories=[/data/app/REDACTED/lib/arm64, /vendor/lib64, /system/lib64]]
E/Crash: Failed to initialize crash reporting
         java.lang.RuntimeException: com.google.android.gms.internal.zzqb$zza: Failed to instantiate module class: com.google.android.gms.crash.internal.api.CrashApiImpl
             at com.google.android.gms.internal.zzph.zztD(Unknown Source)
             at com.google.android.gms.crash.Crash.init(Unknown Source)
             at com.google.android.gms.crash.internal.provider.CrashInitContentProvider.onCreate(Unknown Source)
             at android.content.ContentProvider.attachInfo(ContentProvider.java:1748)
             at android.content.ContentProvider.attachInfo(ContentProvider.java:1723)
             at android.app.ActivityThread.installProvider(ActivityThread.java:5158)
             at android.app.ActivityThread.installContentProviders(ActivityThread.java:4753)
             at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4693)
             at android.app.ActivityThread.-wrap1(ActivityThread.java)
             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
             at android.os.Handler.dispatchMessage(Handler.java:102)
             at android.os.Looper.loop(Looper.java:148)
             at android.app.ActivityThread.main(ActivityThread.java:5422)
             at java.lang.reflect.Method.invoke(Native Method)
             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
          Caused by: com.google.android.gms.internal.zzqb$zza: Failed to instantiate module class: com.google.android.gms.crash.internal.api.CrashApiImpl
             at com.google.android.gms.internal.zzqb.zzdr(Unknown Source)
             at com.google.android.gms.internal.zzph.zztD(Unknown Source) 
             at com.google.android.gms.crash.Crash.init(Unknown Source) 
             at com.google.android.gms.crash.internal.provider.CrashInitContentProvider.onCreate(Unknown Source) 
             at android.content.ContentProvider.attachInfo(ContentProvider.java:1748) 
             at android.content.ContentProvider.attachInfo(ContentProvider.java:1723) 
             at android.app.ActivityThread.installProvider(ActivityThread.java:5158) 
             at android.app.ActivityThread.installContentProviders(ActivityThread.java:4753) 
             at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4693) 
             at android.app.ActivityThread.-wrap1(ActivityThread.java) 
             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405) 
             at android.os.Handler.dispatchMessage(Handler.java:102) 
             at android.os.Looper.loop(Looper.java:148) 
             at android.app.ActivityThread.main(ActivityThread.java:5422) 
             at java.lang.reflect.Method.invoke(Native Method) 
             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
          Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.crash.internal.api.CrashApiImpl" on path: DexPathList[[zip file "/data/user/0/com.google.android.gms/app_chimera/m/00000002/DynamiteModulesC_GmsCore_prodmnc_alldpi_release.apk"],nativeLibraryDirectories=[/data/user/0/com.google.android.gms/app_chimera/m/00000002/n/arm64-v8a, /vendor/lib64, /system/lib64]]
             at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
             at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
             at com.google.android.chimera.container.internal.DelegateLastPathClassLoader.loadClass(SourceFile:22)
             at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
             at com.google.android.gms.internal.zzqb.zzdr(Unknown Source) 
             at com.google.android.gms.internal.zzph.zztD(Unknown Source) 
             at com.google.android.gms.crash.Crash.init(Unknown Source) 
             at com.google.android.gms.crash.internal.provider.CrashInitContentProvider.onCreate(Unknown Source) 
             at android.content.ContentProvider.attachInfo(ContentProvider.java:1748) 
             at android.content.ContentProvider.attachInfo(ContentProvider.java:1723) 
             at android.app.ActivityThread.installProvider(ActivityThread.java:5158) 
             at android.app.ActivityThread.installContentProviders(ActivityThread.java:4753) 
             at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4693) 
             at android.app.ActivityThread.-wrap1(ActivityThread.java) 
             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405) 
             at android.os.Handler.dispatchMessage(Handler.java:102) 
             at android.os.Looper.loop(Looper.java:148) 
             at android.app.ActivityThread.main(ActivityThread.java:5422) 
             at java.lang.reflect.Method.invoke(Native Method) 
             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
            Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.crash.internal.api.CrashApiImpl
             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:469)
             at com.google.android.chimera.container.internal.FilteringClassLoader.loadClass(SourceFile:472)
             at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
                    ... 19 more
          Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

Error Failed to resolve: com.google.firebase:firebase-auth:9.0.0

Help.I need to migrate my code base.Am so madly in love with the new firebase features.I followed all the instructions by altering all my build.gradle files in android studio just to start using the new features but this is what I keep getting...Error Failed to resolve: com.google.firebase:firebase-auth:9.0.0,Error Failed to resolve: com.google.firebase:firebase-database:9.0.0.Please help..Thanks

Google Login not working with Note 4 (6.0.1)

After i get a valid token from google auth, auth at the firebase backend fails.
This happend on my Note 4 with 6.0.1. I have no problems with the emultar, S3, A3 and S3 mini.
Any suggestions?

lg.

NullPointerException in FirebaseMessagingService

I got this crash today. First day in production.
The crash report is from Crashalytics.

Fatal Exception: java.lang.NullPointerException
       at com.google.firebase.messaging.FirebaseMessagingService.zzT(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzn(Unknown Source)
       at com.google.firebase.messaging.FirebaseMessagingService.zzm(Unknown Source)
       at com.google.firebase.iid.zzb$2.run(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
       at java.lang.Thread.run(Thread.java:856)

FCM when app in background

Hi,

The FCM works fine when the app is in foreground and a push comes, but when the app is in background and the system tray notification is clicked , it just opens up the app without passing any intent extras. I have added the click_action in Notification Payload from Advanced option of Firebase Console to open an activity but it dosen't work. I have also added the intent-filter ( handle backgound app section) as in documentation.

How can i open a specific activity using FCM service along with the data i pass when the app is in background or exit state.

Firebase Invite always failed...

I wonder why does always fail (resultCode : 3) about 'Firebase Invites' sample app.
What about others? Why does the fail occur?

FriendlyPing

I know this is not a place to ask for example requests but I was working on updating the friendlyPing application to use Firebase messaging to get myself familiar with it but I ran into a few different issue with parsing the data. If by any chance you could update that sample to use Firebase messaging that would be highly appreciated. Mostly because friendlyPing also includes an XMPP server example.

Thanks for all your work.

GetInvitation resultCallback is called twice

GetInvitation resultCallback is called when I tap a deep link. But after that if I force stop my app and relaunch the main activity through the launcher, the callback is triggered again.
The first time AppInviteReferral.hasReferral(getIntent())) is true but when it is triggered again it is false.
This is in onCreate of MainActivity:

`       boolean autoLaunchDeepLink = false;`
`       AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, autoLaunchDeepLink)`
`                .setResultCallback(`
`                        new ResultCallback<AppInviteInvitationResult>() {`
`                            @Override`
`                            public void onResult(@NonNull AppInviteInvitationResult result) {`
`                                if (result.getStatus().isSuccess()) {`
`                                    Intent intent = result.getInvitationIntent();`
`                                    Intent launchGameIntent = new Intent(MainActivity.this, GameActivity.class);`
`                                    startActivity(launchGameIntent);`
`                                } else {`
`                                    Log.d("tag", "getInvitation: no deep link found.");`
`                                }`
`                            }`
`                        });`
`    }     `

subscribe to topic button not creating a topic in the firebase console

In the messaging quickstart app, the subscribe to news button is suppose to create a "news" topic in the firebase console, but even after I click it, the firebase console still shows the "This project does not have any topics" message when I click the topic bubble.

I can send notifications when I click the "User segment" button and when I click the "Single device" button. So firebase is aware of the installation of the app on the device and the token that was created for the device. It's just the subscribing to a topic feature that is not successfully communicating with firebase.

Isn't there any Authentication by email yet?

Hi

I've already checked in email authentication firebase console.

firebase console -> Auth -> email template
you can see those three menus in there.(email authentication, change password, change email address)

But I couldn't see any api in android api document.(email authentication, change email address)
(I found sending change password api)

How can I clone this project?

Hi guys,

I am sorry for being a noob at the moment. I tried to clone the whole project to try and test it out.
But when I tried to clone it using Android Studio 2.1.2 (Checkout From Version Control -> Github -> https://github.com/firebase/quickstart-android.git -> Create project from existing sources ), I just got a series of folders but couldn't run it.

I am having a problem with the Gradle if I chose

"Import project from external model"

saying

"The project is using an unsupported version of Gradle. Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)"

So I am quite at a loss on how to try cloning the project and see how this works. Hope someone with a good soul can help out. Thanks!

Firebase Dynamic links always returned CANCELED

I'm using dynamic links for my app.

I've followed the tutorial step-by-step and I'm able to open the app by clicking on the link posted on facebook.

But when I invoke getInvitation, I always have CANCELED as status of AppInviteInvitationResult.

    AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, false).setResultCallback(
            new ResultCallback<AppInviteInvitationResult>() {
                @Override
                public void onResult(@NonNull AppInviteInvitationResult result) {
                    if (result.getStatus().isSuccess()) {
                        // Extract deep link from Intent
                        Intent intent = result.getInvitationIntent();
                        String deepLink = AppInviteReferral.getDeepLink(intent);

                        // [END_EXCLUDE]
                    } else {
                        Log.d("StartActivity", "getInvitation: no deep link found.");
                    }
                }
            });

Into debug, I can see that result.getStatus() returns CANCELED, but the click on lick open the app correctly.

Where I'm wrong?

[invites] Invite button click crashes Google Play services with missing permission for android.permission.READ_CONTACTS

The invite button does not work on Android 6.0.1, device A0001 due to a security exception after I clicked the button and selected an account. Please see below for the log:

06-07 17:40:15.586 26744-26755/? E/DatabaseUtils: Writing exception to parcel
                                                  java.lang.SecurityException: Permission Denial: reading com.android.providers.contacts.ContactsProvider2 uri content://com.android.contacts/contacts from pid=27333, uid=10013 requires android.permission.READ_CONTACTS, or grantUriPermission()
                                                      at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:605)
                                                      at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:480)
                                                      at android.content.ContentProvider$Transport.query(ContentProvider.java:211)
                                                      at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
                                                      at android.os.Binder.execTransact(Binder.java:453)
06-07 17:40:15.613 27333-27333/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                   Process: com.google.android.gms.ui, PID: 27333
                                                   java.lang.RuntimeException: Unable to resume activity {com.google.android.gms/com.google.android.gms.appinvite.AppInviteActivity}: java.lang.SecurityException: Permission Denial: reading com.android.providers.contacts.ContactsProvider2 uri content://com.android.contacts/contacts from pid=27333, uid=10013 requires android.permission.READ_CONTACTS, or grantUriPermission()
                                                       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3147)
                                                       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3178)
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1407)
                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                       at android.os.Looper.loop(Looper.java:148)
                                                       at android.app.ActivityThread.main(ActivityThread.java:5466)
                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                    Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.contacts.ContactsProvider2 uri content://com.android.contacts/contacts from pid=27333, uid=10013 requires android.permission.READ_CONTACTS, or grantUriPermission()
                                                       at android.os.Parcel.readException(Parcel.java:1620)
                                                       at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
                                                       at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
                                                       at android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
                                                       at android.content.ContentResolver.query(ContentResolver.java:493)
                                                       at android.content.ContentResolver.query(ContentResolver.java:435)
                                                       at dxl.<init>(SourceFile:109)
                                                       at dxl.<init>(SourceFile:85)
                                                       at dvq.onStart(SourceFile:10897)
                                                       at com.google.android.chimera.FragmentProxy.onStart(SourceFile:425)
                                                       at android.support.v4.app.Fragment.performStart(SourceFile:1986)
                                                       at ex.a(SourceFile:1102)
                                                       at ex.a(SourceFile:1248)
                                                       at dy.run(SourceFile:738)
                                                       at ex.i(SourceFile:1613)
                                                       at es.c(SourceFile:330)
                                                       at en.onResume(SourceFile:441)
                                                       at com.google.android.chimera.container.ActivityProxy.superOnResume(SourceFile:2373)
                                                       at com.google.android.chimera.Activity.onResume(SourceFile:357)
                                                       at com.google.android.chimera.Activity.publicOnResume(SourceFile:362)
                                                       at com.google.android.chimera.container.ActivityProxy.onResume(SourceFile:294)
                                                       at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1259)
                                                       at android.app.Activity.performResume(Activity.java:6327)
                                                       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3136)
                                                       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3178) 
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1407) 
                                                       at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                       at android.os.Looper.loop(Looper.java:148) 
                                                       at android.app.ActivityThread.main(ActivityThread.java:5466) 
                                                       at java.lang.reflect.Method.invoke(Native Method) 
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

Firebase database Persistence not working

I m not able to enable the presistence, see here i m doing this as per the new api

`
public class App extends Application {
@OverRide
public void onCreate() {
super.onCreate();
FirebaseDatabase.getInstance().setPersistenceEnabled(true);
}

}
`

but still its not working, its crashing and giving error:

FATAL EXCEPTION: main
Process: com.vrjco.v.someapp:background_crash, PID: 30170
java.lang.RuntimeException: Unable to create application com.vrjco.v.someapp.App: java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist.
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4752)
at android.app.ActivityThread.access$1600(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5653)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist.
at com.google.firebase.FirebaseApp.getInstance(Unknown Source)
at com.google.firebase.FirebaseApp.getInstance(Unknown Source)
at com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source)
at com.vrjco.v.someapp.App.onCreate(App.java:14)

Can Firebase console push notification if apps is closed? (User swipe away with the long click menu)

I have tried developing a firebase notification apps with this MyFirebaseMessagingService link and MyFirebaseInstanceIDService link example that will receive notification from the console. However, if I close the apps by swiping away the app from the task manager, the app will no longer be able to receive any notification.

I have tried using a service that return START_STICKY and using it to start the MyFirebaseMessagingService but still couldn't receive any notification.

Is this how the firebase push notification intended to perform or am I doing it wrongly?

Extra Info. : My apps is working if I only click back but not if I swipe it away in task manager.

The code is not executed at onMessageReceived ()

This method onMessageReceived () is not called when the app in the background. only when in the foreground. when I send a push msg from FCM console, it shows a notification as of a hidden implementation in the FCM Library itself that overrides my implemntation.

The documentation is also a bit vague.
public void onMessageReceived (RemoteMessage message)

Also: Google Play Services
Called when a message is received. This is also called when a notification message is received while the app is in the foreground. The notification parameters can be retrieved with getNotification().

Unable to load your database

Am having an Issue.Am migrating from the legacy console to the new console.But after the migration I keep getting Unable to load your database.Am I doing something wrong.Pls help.Thanks

Firebase auth error -23, "limits exceeded" on staging server

I can authenticate the user on iOS without any issues, so Firebase is accepting auth requests for this user. It is working for iOS auth on both our staging AND production Firebase URLs.

However, on Android simulator/device I cannot login with same user on the staging Firebase.

I have tried using older login example with 'com.firebase:firebase-client-android:2.0.3+' as we well as newer example using Google GSM and com.google.firebase:firebase-auth:9.0.2. Both return auth error -23 with message "limits exceeded".

Does this require some additional settings or config in the Firebase dashboard?

Thanks,
Anthony

E/RunLoop: Uncaught exception in Firebase runloop (3.0.0)

Strange error! what is the issue behind this?
Recently only, I'm seeing this error :(

compile 'com.google.firebase:firebase-database:9.0.2'
compile "'om.google.firebase:firebase-auth:9.0.2'

E/RunLoop: Uncaught exception in Firebase runloop (3.0.0). Please report to [email protected]                                                
 java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.internal.zzafg.zzg(com.google.android.gms.internal.zzafa, com.google.android.gms.internal.zzahu)' on a null object reference
                                                                   at com.google.android.gms.internal.zzafc.zzb(Unknown Source)
                                                                   at com.google.android.gms.internal.zzafc.zzat(Unknown Source)
                                                                   at com.google.firebase.database.connection.idl.IPersistentConnectionImpl$3.zzJ(Unknown Source)
                                                                   at com.google.firebase.database.connection.idl.zzi$zza.onTransact(Unknown Source)
                                                                   at android.os.Binder.transact(Binder.java:387)
                                                                   at alx.a(:com.google.android.gms.DynamiteModulesC:211)
                                                                   at amb.a(:com.google.android.gms.DynamiteModulesC:339)
                                                                   at akf.a(:com.google.android.gms.DynamiteModulesC:6851)
                                                                   at ajt.a(:com.google.android.gms.DynamiteModulesC:5191)
                                                                   at akw.b(:com.google.android.gms.DynamiteModulesC:226)
                                                                   at akw.a(:com.google.android.gms.DynamiteModulesC:271)
                                                                   at ald.run(:com.google.android.gms.DynamiteModulesC:1020)
                                                                   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
                                                                   at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
                                                                   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                   at java.lang.Thread.run(Thread.java:818)

Email not appearing for FirebaseUser when used with GoogleSigninActivity

This may have been inherited from FirebseAuth, when logging in with Google account the firebase user email is empty/null.
Seems we have to manually update email whereas photo Url is seamlessly picked up by firebase user !

Till few days ago (com.firebase) when users were added with google sign-in, email was added automatically as seen on users console.

Authentication failed refresh Token

I'm using Firebase Authentication 9.0.2 (Facebook, Google, email/password or anonymous) in my Android app, this part works correctly.

mAuthListener = new FirebaseAuth.AuthStateListener() {
        @Override
        public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
            FirebaseUser user = firebaseAuth.getCurrentUser();
            if (user != null && !flagAuth) {
                // User is signed in
            } else if (user == null) {
                // User is signed out
            }
        }
    };

After this, I'm listening on database.getReference(".info/connected") and database.getReference(".info/authenticated"), first time I'm connecting these 2 values are true for all authenticated providers. When I'm restarted my application, it is always true.

final DatabaseReference refAuthenticated = database.getReference(".info/authenticated");
    refAuthenticated.addValueEventListener(new ValueEventListener() {
        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {
            boolean connected = dataSnapshot.getValue(Boolean.class);
            if (connected) {
                AppLog.d("Authenticated");
                });
            } else {
                AppLog.d("No more Authenticated");
            }
        }

        @Override
        public void onCancelled(DatabaseError databaseError) {
            AppLog.d("Listener was cancelled at .info/authenticated");
        }
    });

But after 1 hour (when my token is expired), Firebase SDK has to refresh the token automatically but it failed with this error

pc_0 - Authentication failed: expired_token (Auth token is expired)

Or this one

pc_0 - Authentication failed: invalid_token (Invalid claim 'kid' in auth header.)

I have checked my SHA-1 key in my Firebase project and it is correct.

Anybody can help me?
Thank you.

Gradle compile missing

I had to add this line to my module gradle :
compile 'com.google.android.gms:play-services:9.0.0'
in order to compile code.

Topic not being created with FirebaseMessaging.getInstance().subscribeToTopic(...)

Hello,

I am able to successfully send notifications to a single device and I am able to send them to a user segment, but in the Firebase Notifications console for my application for Target=Topic it shows "This project does not have any topics" even though I called FirebaseMessaging.getInstance().subscribeToTopic() from my Android application with several different topic names days ago.

The documentation for this is very sparse. Does this call not actually create a new topic? Is an HTTP call required to create the topic before the Android client can subscribe to it through this API?

If this API should indeed create the topic then how long does it take? I have been waiting almost 3 days now for it to appear in the console. I do not see any exceptions or errors generated on the client side when I make the call.

This was from a Samsung Galaxy S6 with Marshmallow.

Thanks,
Thomas

FirebaseMessagingService Custom notifcations/other tasks when app is in backgorund

ISSUE FIXED

I have switched from gcm to firebase messaging and I regret it now.

I know it clearly states in documentation that Notifications delivered when your app is in the background. In this case, the notification is delivered to the device’s system tray.
A user click on a notification opens the app launcher by default.

But onMessageReceived is not called when the app is background or killed
that means i don't know when a messaged is received and cant really write code according to that
and since my application needs to perform other task when this messaged is received, I cant find a way to do it.

and Additional Information This is the from only the tests i conducted from the firebase console and not the apis

and please explain this a little more:
When you send a notification from the Firebase console and your app is in the background it cannot be customized.

If you want custom background notifications you should use the FCM API to send data messages to your app and handle them in the FirebaseMessagingService where you can decide how the notification should look.

ISSUE TO FIX

1) I WANT DO CREATE A CUSTOMIZED MESSAGE WITHOUT THE DATA FROM THE MESSAGE AND ALSO PERFORM OTHER THINGS WHEN I RECEIVE THE MESSAGE.

2) And if onMessageReceived is not called then what part of the service or method is called ?

3) Is moving back to GCM my only option ?

But the idea of it only sounds so bad.
Please fix this in the future release .

PS: I have read through the closed issue which still doesn't solve this problem

HERE IS THE PROBLEM AND SOLUTION

Problem

Switching from the old gcm to new FirebaseMessagingService i thought it would be good to test hence i created messages using firebase console and only found that when app is background my custom notification was not working and Firebase onMessageReceived not called when app in background

In SHORT SOLUTION

It happens only when sending messages through console of firebase and not the apis

Solution

I tried to create messages from the api and only then did i realize that the Firebase onMessageReceived not called when app in background issue happens only when creating messages from the Firebase Console and not when sent from API

PS: FIREBASE TEAM PLEASE CLEARLY MENTION THIS IN THE CONSOLE, SINCE MANY PEOPLE HAVE THE SAME QUESTION

Request for user profile from GMail is returning null

I would like to retrieve the user's profile picture and name after google login:

GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestIdToken(getString(R.string.default_web_client_id))
            .requestEmail()
            .requestProfile()
            .build();

...
mAuthListener = new FirebaseAuth.AuthStateListener() {
        @Override
        public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
            FirebaseUser user = firebaseAuth.getCurrentUser();
            if (user != null) {
                // User is signed in
        Log.v(TAG,"pic "+user.getPhotoUrl()+" name "+user.getDisplayName());
            } else {
                // User is signed out
                Log.d(TAG, "onAuthStateChanged:signed_out");
            }
        }
    };

In the logcat am getting: pic null name null

Get facebook user's info

I have no clue about getting user's facebook info from the current Firebase version. In old versions, onAuthenticated callback function had AuthData object which used to get user's info. How can this be done now?

ArrayList cannot be cast to java.util.Map

Database error while retriving data after Importing Json in dashboard database...
com.android.sample W/System.err: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map

FirebaseRemoteConfigFetchException when fetching Remote Config

Using GMS and Firebase 9.0.2

I set up my app with Firebase, features like Analytics or Notifications are already working. Now I tried to add Remote Config but every time I call fetch, I get a com.google.firebase.remoteconfig.FirebaseRemoteConfigFetchException.

I'm not doing anything special. Basicly, all I do is

FirebaseRemoteConfig.getInstance().fetch().addOnCompleteListener {
    toast(it.isSuccessful.toString())
    it.exception?.printStackTrace()
}

in my main activity's onCreate method (nevermind the Kotlin syntax) and every time I get

com.google.firebase.remoteconfig.FirebaseRemoteConfigFetchException
  at com.google.firebase.remoteconfig.FirebaseRemoteConfig.zza(Unknown Source)
  at com.google.firebase.remoteconfig.FirebaseRemoteConfig$1.zza(Unknown Source)
  at com.google.firebase.remoteconfig.FirebaseRemoteConfig$1.onResult(Unknown Source)
  at com.google.android.gms.internal.zznv$zza.zzb(Unknown Source)
  at com.google.android.gms.internal.zznv$zza.handleMessage(Unknown Source)
  at android.os.Handler.dispatchMessage(Handler.java:102)
  at android.os.Looper.loop(Looper.java:148)
  at android.app.ActivityThread.main(ActivityThread.java:5417)
  at java.lang.reflect.Method.invoke(Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

How to clear Firebase Crash reports?

I am using Firebase crash reporting service for android.
Can any one help me to clear crash report from Firebase console or any way to remove it by Firebase crash android API?

D/FirebaseInstanceId: background sync failed: INVALID_PARAMETERS

Hi,

I've have successfully registered a device and gotten a device token.
However, after I tried subscribing a topic, it keeps showing this error " D/FirebaseInstanceId: background sync failed: INVALID_PARAMETERS", and no topic was shown in console for past few hours.

Firebase database getInstance crashes app

When running the sample after creating google-service.json the app crashes when trying to get database reference in SignInActivity

mDatabase = FirebaseDatabase.getInstance().getReference();

05-21 09:27:27.644 488-488/com.google.firebase.quickstart.database D/AndroidRuntime: Shutting down VM
05-21 09:27:27.644 488-488/com.google.firebase.quickstart.database E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                     Process: com.google.firebase.quickstart.database, PID: 488
                                                                                     java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.firebase.quickstart.database/com.google.firebase.quickstart.database.SignInActivity}: com.google.firebase.database.DatabaseException: Failed to get FirebaseDatabase instance: FirebaseApp object has no DatabaseURL in its FirebaseOptions object.
                                                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
                                                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
                                                                                         at android.app.ActivityThread.access$800(ActivityThread.java:151)
                                                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
                                                                                         at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                         at android.os.Looper.loop(Looper.java:135)
                                                                                         at android.app.ActivityThread.main(ActivityThread.java:5254)
                                                                                         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:903)
                                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
                                                                                      Caused by: com.google.firebase.database.DatabaseException: Failed to get FirebaseDatabase instance: FirebaseApp object has no DatabaseURL in its FirebaseOptions object.
                                                                                         at com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source)
                                                                                         at com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source)
                                                                                         at com.google.firebase.quickstart.database.SignInActivity.onCreate(SignInActivity.java:39)
                                                                                         at android.app.Activity.performCreate(Activity.java:5990)
                                                                                         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
                                                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
                                                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 
                                                                                         at android.app.ActivityThread.access$800(ActivityThread.java:151) 
                                                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
                                                                                         at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                         at android.os.Looper.loop(Looper.java:135) 
                                                                                         at android.app.ActivityThread.main(ActivityThread.java:5254) 
                                                                                         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:903) 
                                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 

Question: A/B testing +RemoteConfigs- how to track, and is cacheExpiration needed?

I can't find a sample or tutorial about how to track the current variant of the experiment.
For example, suppose we have 2 variants for the position of an button, and we wish to track how many people pressed the button on each variant. I'd also like to know where in the console website I need to see the stats.

I also don't understand the need for cacheExpiration when calling :

mFirebaseRemoteConfig.fetch(cacheExpiration)

Is it really needed? Shouldn't there be an option that the cache will stay for as long as it can, perhaps removing it upon app-update? Or override it when there is new data from the server?

Firebase API initialization failure. (java.lang.IncompatibleClassChangeError)

Hi,

    FirebaseMessaging.getInstance().subscribeToTopic("global");

this line causing en error:

05-26 15:52:42.551 11612-11612/com.lotram.uygulamacoapp A/FirebaseApp: Firebase API initialization failure. java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.google.firebase.FirebaseApp.zza(Unknown Source) at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) at com.google.firebase.FirebaseApp.zzbu(Unknown Source) at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) at android.content.ContentProvider.attachInfo(ContentProvider.java:1714) at android.content.ContentProvider.attachInfo(ContentProvider.java:1683) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) at android.app.ActivityThread.installProvider(ActivityThread.java:5012) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4607) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4547) at android.app.ActivityThread.access$1500(ActivityThread.java:148) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5272) 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:909) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704) Caused by: java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar) at com.google.firebase.iid.zzg.zzeC(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzd.zzb(Unknown Source) at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source) at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.google.firebase.FirebaseApp.zza(Unknown Source)  at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)  at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)  at com.google.firebase.FirebaseApp.zzbu(Unknown Source)  at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)  at android.content.ContentProvider.attachInfo(ContentProvider.java:1714)  at android.content.ContentProvider.attachInfo(ContentProvider.java:1683)  at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)  at android.app.ActivityThread.installProvider(ActivityThread.java:5012)  at android.app.ActivityThread.installContentProviders(ActivityThread.java:4607)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4547)  at android.app.ActivityThread.access$1500(ActivityThread.java:148)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5272)  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:909)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704)  05-26 15:52:43.401 11612-11612/com.lotram.uygulamacoapp E/ApkAssets: Error while loading asset assets/icudtl.dat: java.io.FileNotFoundException: assets/icudtl.dat 05-26 15:52:44.017 11612-11612/com.lotram.uygulamacoapp E/AndroidRuntime: FATAL EXCEPTION: main Process: com.lotram.uygulamacoapp, PID: 11612 java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar) at com.google.firebase.iid.zzg.zzeC(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzd.zzb(Unknown Source) at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source) at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source) at com.google.firebase.messaging.FirebaseMessaging.getInstance(Unknown Source) at com.lotram.uygulamacoapp.MainActivity.onCreate(MainActivity.java:51) at android.app.Activity.performCreate(Activity.java:5977) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2258) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365) at android.app.ActivityThread.access$800(ActivityThread.java:148) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5272) 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:909) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704) 05-26 15:59:59.507 17613-17613/com.lotram.uygulamacoapp A/FirebaseApp: Firebase API initialization failure. java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.google.firebase.FirebaseApp.zza(Unknown Source) at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) at com.google.firebase.FirebaseApp.zzbu(Unknown Source) at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) at android.content.ContentProvider.attachInfo(ContentProvider.java:1714) at android.content.ContentProvider.attachInfo(ContentProvider.java:1683) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) at android.app.ActivityThread.installProvider(ActivityThread.java:5012) at android.app.ActivityThread.installContentProviders(ActivityThread.java:4607) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4547) at android.app.ActivityThread.access$1500(ActivityThread.java:148) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5272) 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:909) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704) Caused by: java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar) at com.google.firebase.iid.zzg.zzeC(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzd.zzb(Unknown Source) at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source) at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.google.firebase.FirebaseApp.zza(Unknown Source)  at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)  at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)  at com.google.firebase.FirebaseApp.zzbu(Unknown Source)  at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)  at android.content.ContentProvider.attachInfo(ContentProvider.java:1714)  at android.content.ContentProvider.attachInfo(ContentProvider.java:1683)  at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)  at android.app.ActivityThread.installProvider(ActivityThread.java:5012)  at android.app.ActivityThread.installContentProviders(ActivityThread.java:4607)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4547)  at android.app.ActivityThread.access$1500(ActivityThread.java:148)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5272)  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:909)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704)  05-26 16:00:00.275 17613-17613/com.lotram.uygulamacoapp E/ApkAssets: Error while loading asset assets/icudtl.dat: java.io.FileNotFoundException: assets/icudtl.dat 05-26 16:00:00.694 17613-17613/com.lotram.uygulamacoapp E/AndroidRuntime: FATAL EXCEPTION: main Process: com.lotram.uygulamacoapp, PID: 17613 java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar) at com.google.firebase.iid.zzg.zzeC(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzg.<init>(Unknown Source) at com.google.firebase.iid.zzd.zzb(Unknown Source) at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source) at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source) at com.google.firebase.messaging.FirebaseMessaging.getInstance(Unknown Source) at com.lotram.uygulamacoapp.MainActivity.onCreate(MainActivity.java:64) at android.app.Activity.performCreate(Activity.java:5977) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2258) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365) at android.app.ActivityThread.access$800(ActivityThread.java:148) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5272) 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:909) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704)

my app/build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.lotram.uygulamacoapp"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    maven {
        url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.android.support:design:23.2.1'
    compile 'org.xwalk:xwalk_core_library:17.46.448.10'
    compile 'com.loopj.android:android-async-http:1.4.9'
    compile 'org.apache.commons:commons-io:1.3.2'

    compile 'com.google.firebase:firebase-messaging:9.0.0'
}

apply plugin: 'com.google.gms.google-services'

and my project/build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
        classpath 'com.google.gms:google-services:3.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Google FCM getIntent return null on app is not running

Please help me! I check debug this code extras alway return null when click on new notification, if app is not running, and show good on app is running

    @Override
    public void onNewIntent(Intent intent) {
        Bundle extras = intent.getExtras();
        if (extras != null) {
            if (extras.containsKey("local_notification_message")) {
            }
        }
    }

How to know the data sent to the database has reached successfully?

   mDatabase = FirebaseDatabase.getInstance().getReference();
    Task<Void> base = mDatabase.child("demo").child(id).setValue(story);

    Log.d(TAG, "getEditTextVals: This is after base");
    if(base.isComplete()){

        Log.d(TAG, "getEditTextVals: completed");

    }
    if (base.isSuccessful()){
        Log.d(TAG, "getEditTextVals: successful");
        Intent intent = new Intent(getApplication(), MainActivity.class);
        startActivity(intent);
        finish();

    }

What this doesn't do is, it doesn't call isComplete, or isSuccessful, meaning those are all fasle.

Why the expiry time of Firebase custom auth token is limited to max 1Hr(3600sec) ?

exp The time, in seconds, at which the token expires. It can be at a maximum 3600 seconds later than iat.

I'm doing a chat application using Firebase. where I need to listen for incoming messages most of the time. If auth token expires every hour, its difficult for me to maintain the valid session all the time :(

In Legacy Firebase system, token expiry time was too flexiable; where we can adjust TTL value from 1Hr to as many years!! Never expire option was also there!

Why the current Firebase API, is forcing the client to refresh the Auth token every hour?

Also, I couldn't verify the Auth session length at client side,
In Firebase 9.0.0 API, how to check the user has valid Auth session or not?

Kindly help me on this.Thanks in advance!

Real-time database login does not work on simulator

Followed all instructions and got the run time error:
E/DynamiteModule: Failed to load module descriptor class: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor"

Any suggestions?

W/SyncTree: Listen at /message failed: DatabaseError: Permission denied

06-02 12:42:49.892 750-750/com.android.firebase_database W/MainActivity: Failed to read value.
com.google.firebase.database.DatabaseException: Firebase Database error: Permission denied
at com.google.firebase.database.DatabaseError.toException(Unknown Source)
at com.android.firebase_database.MainActivity$1.onCancelled(MainActivity.java:40)
at com.google.android.gms.internal.zzafp.zza(Unknown Source)
at com.google.android.gms.internal.zzagn.zzSu(Unknown Source)
at com.google.android.gms.internal.zzags$1.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5930)
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:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
06-02 12:42:49.892 750-795/com.seehash.firebase_database W/RepoOperation: setValue at /message failed: DatabaseError: Permission denied

How to enable the permission in Firebase Database..
Can some one help me am facing this permission denied

Failed to load module descriptor class

There seems to be problem with the app or perhaps I am running it in the wrong way. I am able to start the app. However, if I tap on "Sign in" the app does not respond, but the Android Monitor shows the following error:

image

06-07 02:18:39.017 6396-6396/com.google.firebase.quickstart.firebasestorage E/Storage#MainActivity: signInAnonymously:FAILURE
com.google.firebase.FirebaseException: An internal error has occured. [ OPERATION_NOT_ALLOWED ]
at com.google.android.gms.internal.zzacq.zzbN(Unknown Source)
at com.google.android.gms.internal.zzacn$zzg.zza(Unknown Source)
at com.google.android.gms.internal.zzacy.zzbO(Unknown Source)
at com.google.android.gms.internal.zzacy$zza.onFailure(Unknown Source)
at com.google.android.gms.internal.zzact$zza.onTransact(Unknown Source)
at android.os.Binder.execTransact(Binder.java:453)
06-07 02:18:47.052 6396-6426/com.google.firebase.quickstart.firebasestorage I/FA: Tag Manager is not found and thus will not be used
06-07 02:18:48.353 6396-6413/com.google.firebase.quickstart.firebasestorage E/DynamiteModule: Failed to load module descriptor class: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor" on path: DexPathList[[zip file "/data/app/com.google.firebase.quickstart.firebasestorage-1/base.apk"],nativeLibraryDirectories=[/data/app/com.google.firebase.quickstart.firebasestorage-1/lib/arm, /vendor/lib, /system/lib]]

What could be missing?

Google Login not working

I downloaded the google-services.json in the right place but the Google Sign On does not work.

V/FirebaseCrash: Firebase Crash Reporting is disabled.

HI,
Im facing this type of issue,can you help me how to rectify, how to make enable firebase crash reporting.,this my error in logcat

V/FirebaseCrash: Firebase Crash Reporting is disabled.
E/FirebaseCrash: Failed to initialize crash reporting
com.google.firebase.crash.internal.zzg$zza: com.google.android.gms.internal.zzqi$zza: No acceptable module found. Local version is 0 and remote version is 0.
at com.google.firebase.crash.internal.zzg.zzah(Unknown Source)
at com.google.firebase.crash.FirebaseCrash.(Unknown Source)
at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.google.firebase.FirebaseApp.zza(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.zzbu(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1591)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1562)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:4866)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4461)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4401)
at android.app.ActivityThread.access$1500(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1270)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5097)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: com.google.android.gms.internal.zzqi$zza: No acceptable module found. Local version is 0 and remote version is 0.
at com.google.android.gms.internal.zzqi.zza(Unknown Source)
at com.google.firebase.crash.internal.zzg.zzah(Unknown Source) 
at com.google.firebase.crash.FirebaseCrash.(Unknown Source) 
at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.google.firebase.FirebaseApp.zza(Unknown Source) 
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
at com.google.firebase.FirebaseApp.zzbu(Unknown Source) 
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1591) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1562) 
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) 
at android.app.ActivityThread.installProvider(ActivityThread.java:4866) 
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4461) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4401) 
at android.app.ActivityThread.access$1500(ActivityThread.java:139) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1270) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5097) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 
at dalvik.system.NativeStart.main(Native Method) 
05-23 17:17:17.450 2462-2462/com.example.balaji.samplefirebase D/FirebaseApp: Initialized class com.google.firebase.crash.FirebaseCrash.
05-23 17:17:17.693 2462-2462/com.example.balaji.samplefirebase V/FirebaseCrash: Firebase Crash Reporting is disabled.
05-23 17:17:17.693 2462-2462/com.example.balaji.samplefirebase V/FirebaseCrash: Firebase Crash Reporting is disabled.
05-23 17:32:50.064 17461-17461/com.example.balaji.samplefirebase E/FirebaseCrash: Failed to initialize crash reporting
com.google.firebase.crash.internal.zzg$zza: com.google.android.gms.internal.zzqi$zza: No acceptable module found. Local version is 0 and remote version is 0.
at com.google.firebase.crash.internal.zzg.zzah(Unknown Source)
at com.google.firebase.crash.FirebaseCrash.(Unknown Source)
at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.google.firebase.FirebaseApp.zza(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.zzbu(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1591)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1562)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:4866)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4461)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4401)
at android.app.ActivityThread.access$1500(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1270)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5097)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: com.google.android.gms.internal.zzqi$zza:
No acceptable module found. Local version is 0 and remote version is 0.
at com.google.android.gms.internal.zzqi.zza(Unknown Source)
at com.google.firebase.crash.internal.zzg.zzah(Unknown Source) at com.google.firebase.crash.FirebaseCrash.(Unknown Source) 
at com.google.firebase.crash.FirebaseCrash.getInstance(Unknown Source) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.google.firebase.FirebaseApp.zza(Unknown Source) 
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
at com.google.firebase.FirebaseApp.zzbu(Unknown Source) 
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1591) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1562) 
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) 
at android.app.ActivityThread.installProvider(ActivityThread.java:4866) 
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4461) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4401) 
at android.app.ActivityThread.access$1500(ActivityThread.java:139) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1270) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5097) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 
at dalvik.system.NativeStart.main(Native Method) 

Remote Config: NullPointerException: Attempt to read from field 'int com.google.android.gms.internal.zzaji$zzc.zzbTG' on a null object

I'm using the Genymotion emulator and since somewhere around last week, my app won't launch anymore when I use Remote Config. Everytime the app starts, I get the following stacktrace:

 java.lang.RuntimeException: Unable to start activity ComponentInfo{my.package.android/my.package.android.MainActivity}: java.lang.NullPointerException: Attempt to read from field 'int com.google.android.gms.internal.zzaji$zzc.zzbTG' on a null object reference
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
       at android.app.ActivityThread.access$800(ActivityThread.java:144)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:135)
       at android.app.ActivityThread.main(ActivityThread.java:5221)
       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:899)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
    Caused by: java.lang.NullPointerException: Attempt to read from field 'int com.google.android.gms.internal.zzaji$zzc.zzbTG' on a null object reference
       at com.google.firebase.remoteconfig.FirebaseRemoteConfig.zza(Unknown Source)
       at com.google.firebase.remoteconfig.FirebaseRemoteConfig.zzbE(Unknown Source)
       at com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance(Unknown Source)
       at my.package.android.logic.ConfigHelper.<init>(ConfigHelper.kt:16)
       at my.package.android.logic.ConfigHelper_Factory.get(ConfigHelper_Factory.java:12)
       at my.package.android.logic.ConfigHelper_Factory.get(ConfigHelper_Factory.java:6)
       at dagger.internal.ScopedProvider.get(ScopedProvider.java:46)
       at my.package.android.MainActivity_MembersInjector.injectMembers(MainActivity_MembersInjector.java:41)
       at my.package.android.MainActivity_MembersInjector.injectMembers(MainActivity_MembersInjector.java:11)
       at my.package.android.DaggerMyApplication_ApplicationComponent.inject(DaggerMyApplication_ApplicationComponent.java:552)
       at my.package.android.MainActivity.onCreate(MainActivity.kt:44)
       at android.app.Activity.performCreate(Activity.java:5933)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360) 
       at android.app.ActivityThread.access$800(ActivityThread.java:144) 
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) 
       at android.os.Handler.dispatchMessage(Handler.java:102) 
       at android.os.Looper.loop(Looper.java:135) 
       at android.app.ActivityThread.main(ActivityThread.java:5221) 
       at java.lang.reflect.Method.invoke(Native Method) 
       at java.lang.reflect.Method.invoke(Method.java:372) 

The emulator is running Android 5.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.