Solucionado (ver solução)
Solucionado
(ver solução)
3
respostas

Token do Firebase não apareceu no LOG.

Toda a configuração do FireBase funcionou e a compilação também, no entanto não aparece nenhum token no log. Veja a baixo, nada do token.

04-03 17:54:56.468 24573-24573/? I/art: Not late-enabling -Xcheck:jni (already on)
04-03 17:54:56.468 24573-24573/? W/art: Unexpected CPU variant for X86 using defaults: x86
04-03 17:54:56.508 24573-24580/? E/art: Failed sending reply to debugger: Broken pipe
04-03 17:54:56.508 24573-24580/? I/art: Debugger is no longer active
04-03 17:54:56.508 24573-24580/? I/art: Starting a blocking GC Instrumentation
04-03 17:54:56.517 24573-24580/? W/art: Suspending all threads took: 8.923ms
04-03 17:54:57.095 24573-24573/? W/System: ClassLoader referenced unknown path: /data/app/br.com.alura.agenda-1/lib/x86
04-03 17:54:57.436 24573-24573/? I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
04-03 17:54:57.436 24573-24573/? I/DynamiteModule: Selected local version of com.google.android.gms.flags
04-03 17:54:57.440 24573-24573/? W/System: ClassLoader referenced unknown path: 
04-03 17:54:57.440 24573-24573/? W/System: ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86
04-03 17:54:57.624 24573-24573/br.com.alura.agenda W/art: Verification of void com.google.android.gms.internal.zzbnq.zzaG(android.content.Context) took 145.885ms
04-03 17:54:57.625 24573-24598/br.com.alura.agenda W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
04-03 17:54:57.626 24573-24573/br.com.alura.agenda W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
04-03 17:54:57.638 24573-24573/br.com.alura.agenda I/DynamiteModule: Considering local module com.google.android.gms.crash:0 and remote module com.google.android.gms.crash:4
04-03 17:54:57.638 24573-24573/br.com.alura.agenda I/DynamiteModule: Selected remote version of com.google.android.gms.crash, version >= 4
04-03 17:54:57.670 24573-24573/br.com.alura.agenda W/System: ClassLoader referenced unknown path: /data/user_de/0/com.google.android.gms/app_chimera/m/00000003/n/x86
04-03 17:54:57.682 24573-24573/br.com.alura.agenda I/FirebaseCrashApiImpl: FirebaseCrashApiImpl created by ClassLoader p[DexPathList[[zip file "/data/user_de/0/com.google.android.gms/app_chimera/m/00000003/DynamiteModulesC_GmsCore_prodmnc_alldpi_release.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/00000003/n/x86, /system/lib, /vendor/lib]]]
04-03 17:54:57.794 24573-24598/br.com.alura.agenda W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
04-03 17:54:57.901 24573-24573/br.com.alura.agenda I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
04-03 17:54:57.901 24573-24573/br.com.alura.agenda I/DynamiteModule: Selected local version of com.google.android.gms.flags
04-03 17:54:57.923 24573-24573/br.com.alura.agenda W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
04-03 17:54:58.023 24573-24573/br.com.alura.agenda I/FA: App measurement is starting up, version: 10298
04-03 17:54:58.023 24573-24573/br.com.alura.agenda I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
04-03 17:54:58.067 24573-24573/br.com.alura.agenda V/FA: Collection enabled
04-03 17:54:58.067 24573-24573/br.com.alura.agenda V/FA: App package, google app id: br.com.alura.agenda, 1:348063817846:android:3a5ad5bdb69d3b6a
04-03 17:54:58.067 24573-24573/br.com.alura.agenda I/FA: To enable faster debug mode event logging run:
                                                           adb shell setprop debug.firebase.analytics.app br.com.alura.agenda
04-03 17:54:58.067 24573-24573/br.com.alura.agenda D/FA: Debug-level message logging enabled
04-03 17:54:58.162 24573-24573/br.com.alura.agenda V/FA: Registered activity lifecycle callback
04-03 17:54:58.164 24573-24573/br.com.alura.agenda I/FirebaseCrash: FirebaseCrash reporting initialized com.google.android.gms.internal.zzbnq@6a96fd7
04-03 17:54:58.164 24573-24573/br.com.alura.agenda I/FirebaseInitProvider: FirebaseApp initialization successful
04-03 17:54:58.166 24573-24573/br.com.alura.agenda I/InstantRun: Starting Instant Run Server for br.com.alura.agenda
04-03 17:54:58.172 24573-24627/br.com.alura.agenda V/FA: Using measurement service
04-03 17:54:58.172 24573-24627/br.com.alura.agenda V/FA: Connecting to remote service
04-03 17:54:58.223 24573-24573/br.com.alura.agenda W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
04-03 17:54:58.238 24573-24573/br.com.alura.agenda V/FA: onActivityCreated
04-03 17:54:58.389 24573-24573/br.com.alura.agenda W/nAnnotationIntrospector: Unable to load JDK7 annotation types; will have to skip
04-03 17:54:58.553 24573-24573/br.com.alura.agenda D/NetworkSecurityConfig: No Network Security Config specified, using platform default
04-03 17:54:58.666 24573-24580/br.com.alura.agenda W/art: Suspending all threads took: 15.224ms
04-03 17:54:58.701 24573-24573/br.com.alura.agenda W/System.err: WARNING: could not load Java7 Path class
04-03 17:54:58.812 24573-24627/br.com.alura.agenda V/FA: Using measurement service
04-03 17:54:58.812 24573-24627/br.com.alura.agenda V/FA: Connection attempt already in progress
04-03 17:54:58.814 24573-24627/br.com.alura.agenda V/FA: Activity resumed, time: 2471286
04-03 17:54:58.818 24573-24639/br.com.alura.agenda D/OkHttp: --> GET http://192.168.1.34:8080/api/aluno http/1.1
04-03 17:54:58.818 24573-24639/br.com.alura.agenda D/OkHttp: --> END GET
04-03 17:54:58.822 24573-24573/br.com.alura.agenda I/id do aluno: cd3b1c54-f363-4a96-9538-e500a62d6116
04-03 17:54:58.822 24573-24573/br.com.alura.agenda I/id do aluno: dd800c78-f4c2-46e1-9479-f22e365770cf
04-03 17:54:58.822 24573-24573/br.com.alura.agenda I/id do aluno: 2165a976-3152-4614-9dd4-f8e38a663c47
04-03 17:54:58.932 24573-24643/br.com.alura.agenda I/OpenGLRenderer: Initialized EGL, version 1.4
04-03 17:54:58.932 24573-24643/br.com.alura.agenda D/OpenGLRenderer: Swap behavior 1
04-03 17:54:58.949 24573-24643/br.com.alura.agenda E/EGL_emulation: tid 24643: eglSurfaceAttrib(1178): error 0x3009 (EGL_BAD_MATCH)
04-03 17:54:58.949 24573-24643/br.com.alura.agenda W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa09785e0, error=EGL_BAD_MATCH
04-03 17:54:58.992 24573-24573/br.com.alura.agenda W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
04-03 17:54:59.114 24573-24627/br.com.alura.agenda D/FA: Connected to remote service
04-03 17:54:59.114 24573-24627/br.com.alura.agenda V/FA: Processing queued up service tasks: 2
04-03 17:55:04.138 24573-24627/br.com.alura.agenda V/FA: Inactivity, disconnecting from the service
04-03 17:55:08.816 24573-24627/br.com.alura.agenda V/FA: Session started, time: 2481290
04-03 17:55:08.826 24573-24627/br.com.alura.agenda I/DynamiteModule: Considering local module com.google.android.gms.tagmanager:9 and remote module com.google.android.gms.tagmanager:9
04-03 17:55:08.826 24573-24627/br.com.alura.agenda I/DynamiteModule: Selected remote version of com.google.android.gms.tagmanager, version >= 9
04-03 17:55:08.843 24573-24627/br.com.alura.agenda W/GoogleTagManager: No container asset found in /assets/containers. Checking top level /assets directory for container assets.
04-03 17:55:08.846 24573-24627/br.com.alura.agenda W/GoogleTagManager: Tag Manager's event handler WILL NOT be installed (no container loaded)
04-03 17:55:08.846 24573-24627/br.com.alura.agenda I/GoogleTagManager: Tag Manager initilization took 5ms
04-03 17:55:08.847 24573-24627/br.com.alura.agenda D/FA: Logging event (FE): _s, Bundle[{_o=auto, _sc=ListaAlunosActivity, _si=-1885360192346176135}]
04-03 17:55:08.848 24573-24639/br.com.alura.agenda D/OkHttp: <-- HTTP FAILED: java.net.SocketTimeoutException: connect timed out
04-03 17:55:08.849 24573-24573/br.com.alura.agenda E/onFailure chamado: connect timed out
04-03 17:55:08.859 24573-24627/br.com.alura.agenda V/FA: Using measurement service
04-03 17:55:08.859 24573-24627/br.com.alura.agenda V/FA: Connecting to remote service
04-03 17:55:08.869 24573-24627/br.com.alura.agenda D/FA: Connected to remote service
04-03 17:55:08.869 24573-24627/br.com.alura.agenda V/FA: Processing queued up service tasks: 1
04-03 17:55:13.898 24573-24627/br.com.alura.agenda V/FA: Inactivity, disconnecting from the service
3 respostas

E importante eu ressaltar que está funcionando, a mensagem é recebida no emular, o questionamento é para sanar esta duvido do porque o log não informou o Token igual ao curso. Estou com as versões mais recentes de Android Studio.

Olá Silvânio,

Acredito que está tudo correto com o seu código mas o que pode estar acontecendo é que o método onTokenRefresh() só será chamado quando o seu aplicativo precisar gerar um novo token do Firebase. O que deve ter acontecido é que o seu aplicativo em algum momento já gerou um token válido e agora está usando esse token sem a necessidade de gerar um novo.

Para testar se é isso mesmo, tente desinstalar e reinstalar o seu aplicativo. Ao executá-lo, o aplicativo será forçado a gerar um novo token e nesse caso o log deve aparecer.

solução!

Tranquilo resolvi continuar o curso e a frente descobri que o token é gerado uma única vez. Para gerar novamente teria de desinstalar o app.