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

Token do Firebase não apareceu no LOG. Mobile Android

O token não é gerado e já desinstalei o aplicativo do emulador várias vezes, mas nenhuma das vezes que reinstalava aparecia o token. Até criei diversos emuladores e nenhuma retorna o token

08-21 12:07:18.985 16532-16532/? I/zygote: Not late-enabling -Xcheck:jni (already on)
08-21 12:07:18.997 16532-16532/? W/zygote: Unexpected CPU variant for X86 using defaults: x86
08-21 12:07:19.015 16532-16539/? E/zygote: Failed writing handshake bytes (-1 of 14): Broken pipe
08-21 12:07:19.015 16532-16539/? I/zygote: Debugger is no longer active
08-21 12:07:19.312 16532-16553/? W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
08-21 12:07:19.316 16532-16553/? W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
08-21 12:07:19.325 16532-16532/? W/InstanceID/Rpc: Found 10012
08-21 12:07:19.429 16532-16532/? I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
08-21 12:07:19.429 16532-16532/? I/DynamiteModule: Selected local version of com.google.android.gms.flags
08-21 12:07:19.436 16532-16532/? W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
08-21 12:07:19.439 16532-16532/? I/DynamiteModule: Considering local module com.google.android.gms.crash:0 and remote module com.google.android.gms.crash:4
08-21 12:07:19.439 16532-16532/? I/DynamiteModule: Selected remote version of com.google.android.gms.crash, version >= 4
08-21 12:07:19.440 16532-16532/? W/zygote: Skipping duplicate class check due to unrecognized classloader
08-21 12:07:19.452 16532-16532/? W/zygote: Skipping duplicate class check due to unrecognized classloader
08-21 12:07:19.463 16532-16532/? I/FirebaseCrashApiImpl: FirebaseCrashApiImpl created by ClassLoader p[DexPathList[[zip file "/system/priv-app/PrebuiltGmsCore/app_chimera/m/DynamiteModulesC.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/00000003/n/x86, /system/lib, /system/vendor/lib]]]
08-21 12:07:19.469 16532-16532/? I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
08-21 12:07:19.469 16532-16532/? I/DynamiteModule: Selected local version of com.google.android.gms.flags
08-21 12:07:19.476 16532-16532/? W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
08-21 12:07:19.503 16532-16532/? I/FA: App measurement is starting up, version: 10084
08-21 12:07:19.503 16532-16532/? I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
08-21 12:07:19.503 16532-16532/? D/FA: Debug-level message logging enabled
08-21 12:07:19.503 16532-16532/? D/FA: AppMeasurement singleton hash: 173040871
08-21 12:07:19.514 16532-16532/? V/FA: Collection enabled
08-21 12:07:19.514 16532-16532/? V/FA: App package, google app id: br.com.alura.agenda, 1:870642785316:android:3a5ad5bdb69d3b6a
08-21 12:07:19.514 16532-16532/? I/FA: To enable faster debug mode event logging run:
                                         adb shell setprop debug.firebase.analytics.app br.com.alura.agenda
08-21 12:07:19.530 16532-16532/? V/FA: Registered activity lifecycle callback
08-21 12:07:19.531 16532-16532/? I/FirebaseCrash: FirebaseCrash reporting initialized com.google.android.gms.internal.zzbks@3b66f3d
08-21 12:07:19.532 16532-16532/? I/FirebaseInitProvider: FirebaseApp initialization successful
08-21 12:07:19.532 16532-16532/? I/InstantRun: starting instant run server: is main process
08-21 12:07:19.536 16532-16559/? V/FA: State of service unknown
08-21 12:07:19.536 16532-16559/? V/FA: Checking service availability
08-21 12:07:19.536 16532-16559/? V/FA: Service available
08-21 12:07:19.536 16532-16559/? V/FA: Setting useService: true
08-21 12:07:19.537 16532-16559/? V/FA: Using measurement service
08-21 12:07:19.538 16532-16559/? V/FA: Connecting to remote service
08-21 12:07:19.578 16532-16532/? V/FA: onActivityCreated
08-21 12:07:19.661 16532-16537/? I/zygote: Do partial code cache collection, code=29KB, data=17KB
08-21 12:07:19.661 16532-16537/? I/zygote: After code cache collection, code=26KB, data=16KB
08-21 12:07:19.661 16532-16537/? I/zygote: Increasing code cache capacity to 128KB
08-21 12:07:19.662 16532-16532/? W/nAnnotationIntrospector: Unable to load JDK7 annotation types; will have to skip
08-21 12:07:19.695 16532-16532/? D/NetworkSecurityConfig: No Network Security Config specified, using platform default
08-21 12:07:19.737 16532-16561/? D/OkHttp: --> GET http://10.0.2.2:8080/api/aluno http/1.1
08-21 12:07:19.737 16532-16561/? D/OkHttp: --> END GET
08-21 12:07:19.745 16532-16559/? V/FA: Using measurement service
08-21 12:07:19.746 16532-16559/? V/FA: Connection attempt already in progress
08-21 12:07:19.746 16532-16559/? V/FA: Activity resumed, time: 891144
08-21 12:07:19.768 16532-16564/? D/OpenGLRenderer: HWUI GL Pipeline
08-21 12:07:19.806 16532-16564/? I/OpenGLRenderer: Initialized EGL, version 1.4
08-21 12:07:19.806 16532-16564/? D/OpenGLRenderer: Swap behavior 1
08-21 12:07:19.806 16532-16564/? W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
08-21 12:07:19.806 16532-16564/? D/OpenGLRenderer: Swap behavior 0
08-21 12:07:19.807 16532-16564/? D/EGL_emulation: eglCreateContext: 0x9fe053c0: maj 3 min 1 rcv 4
08-21 12:07:19.817 16532-16564/? D/EGL_emulation: eglMakeCurrent: 0x9fe053c0: ver 3 1 (tinfo 0x9fe03300)
08-21 12:07:19.822 16532-16564/? E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
08-21 12:07:19.822 16532-16564/? E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
08-21 12:07:19.822 16532-16564/? E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824


                                                   [ 08-21 12:07:19.840 16532:16564 D/         ]
                                                   SurfaceInterface::setAsyncMode: set async mode 1
08-21 12:07:19.894 16532-16564/? D/EGL_emulation: eglMakeCurrent: 0x9fe053c0: ver 3 1 (tinfo 0x9fe03300)
08-21 12:07:19.955 16532-16559/? D/FA: Connected to remote service
08-21 12:07:19.955 16532-16559/? V/FA: Processing queued up service tasks: 2
08-21 12:07:20.450 16532-16559/br.com.alura.agenda W/zygote: Long monitor contention with owner pool-3-thread-1 (16565) at long com.android.org.conscrypt.NativeCrypto.RSA_generate_key_ex(int, byte[])(NativeCrypto.java:-2) waiters=0 in java.security.KeyPair com.google.firebase.iid.zzh.zzeM(java.lang.String) for 474ms
08-21 12:07:20.688 16532-16561/br.com.alura.agenda D/OkHttp: <-- 200 OK http://10.0.2.2:8080/api/aluno (951ms)
08-21 12:07:20.688 16532-16561/br.com.alura.agenda D/OkHttp: Server: Apache-Coyote/1.1
08-21 12:07:20.688 16532-16561/br.com.alura.agenda D/OkHttp: Content-Type: application/json;charset=UTF-8
08-21 12:07:20.688 16532-16561/br.com.alura.agenda D/OkHttp: Transfer-Encoding: chunked
08-21 12:07:20.688 16532-16561/br.com.alura.agenda D/OkHttp: Date: Mon, 21 Aug 2017 16:07:35 GMT
08-21 12:07:20.689 16532-16561/br.com.alura.agenda D/OkHttp: {"alunos":[{"id":"29e0c1ff-89b9-46bd-b3ae-f37d494630bc","nome":"DoSite","endereco":"Ali","telefone":"121313121241","site":"oxenteparaguiaiiiiii","nota":10.0,"desativado":0,"idCliente":0},{"id":"443b4b6c-cd98-4be6-980c-ebe4901386a5","nome":"Regivaldo","endereco":"asdasdasdasdq","telefone":"1111111111111","site":"sdasdasdasd","nota":0.0,"desativado":0,"idCliente":0},{"id":"7ba1c300-e1f9-4f1f-b440-091e3e73ab76","nome":"Walderi","endereco":"Rua Abilio Alencar","telefone":"92992096956","site":"walderi.filho@itriad.org.br","nota":10.0,"desativado":0,"idCliente":1},{"id":"84d7a6ae-6ac6-44c3-b970-9af278de661a","nome":"Orlando","endereco":"aaa","telefone":"12311412","site":"afkdjf","nota":0.0,"desativado":0,"idCliente":0}],"momentoDaUltimaModificacao":"2017-08-21T12:07:35.161"}
08-21 12:07:20.689 16532-16561/br.com.alura.agenda D/OkHttp: <-- END HTTP (779-byte body)
08-21 12:07:20.706 16532-16532/br.com.alura.agenda I/id do aluno:: 29e0c1ff-89b9-46bd-b3ae-f37d494630bc
08-21 12:07:20.706 16532-16532/br.com.alura.agenda I/id do aluno:: 443b4b6c-cd98-4be6-980c-ebe4901386a5
08-21 12:07:20.706 16532-16532/br.com.alura.agenda I/id do aluno:: 7ba1c300-e1f9-4f1f-b440-091e3e73ab76
08-21 12:07:20.706 16532-16532/br.com.alura.agenda I/id do aluno:: 84d7a6ae-6ac6-44c3-b970-9af278de661a
08-21 12:07:20.785 16532-16537/br.com.alura.agenda I/zygote: Do partial code cache collection, code=41KB, data=55KB
08-21 12:07:20.785 16532-16537/br.com.alura.agenda I/zygote: After code cache collection, code=41KB, data=55KB
08-21 12:07:20.785 16532-16537/br.com.alura.agenda I/zygote: Increasing code cache capacity to 256KB
08-21 12:07:20.785 16532-16537/br.com.alura.agenda I/zygote: JIT allocated 71KB for compiled code of void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int)
08-21 12:07:20.785 16532-16537/br.com.alura.agenda I/zygote: Compiler allocated 4MB to compile void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int)
08-21 12:07:25.459 16532-16559/br.com.alura.agenda V/FA: Inactivity, disconnecting from the service
08-21 12:07:29.750 16532-16559/br.com.alura.agenda V/FA: Session started, time: 901149
08-21 12:07:29.775 16532-16559/br.com.alura.agenda I/DynamiteModule: Considering local module com.google.android.gms.tagmanager:8 and remote module com.google.android.gms.tagmanager:9
08-21 12:07:29.775 16532-16559/br.com.alura.agenda I/DynamiteModule: Selected remote version of com.google.android.gms.tagmanager, version >= 9
08-21 12:07:29.800 16532-16559/br.com.alura.agenda W/GoogleTagManager: No container asset found in /assets/containers. Checking top level /assets directory for container assets.
08-21 12:07:29.802 16532-16559/br.com.alura.agenda W/GoogleTagManager: Tag Manager's event handler WILL NOT be installed (no container loaded)
08-21 12:07:29.802 16532-16559/br.com.alura.agenda I/GoogleTagManager: Tag Manager initilization took 7ms
08-21 12:07:29.804 16532-16559/br.com.alura.agenda D/FA: Logging event (FE): _s, Bundle[{_o=auto, _sc=ListaAlunosActivity, _si=1601055566620565099}]
08-21 12:07:29.828 16532-16559/br.com.alura.agenda V/FA: Using measurement service
08-21 12:07:29.829 16532-16559/br.com.alura.agenda V/FA: Connecting to remote service
08-21 12:07:29.837 16532-16559/br.com.alura.agenda D/FA: Connected to remote service
08-21 12:07:29.838 16532-16559/br.com.alura.agenda V/FA: Processing queued up service tasks: 1
08-21 12:07:29.845 16532-16537/br.com.alura.agenda I/zygote: Do full code cache collection, code=125KB, data=64KB
08-21 12:07:29.846 16532-16537/br.com.alura.agenda I/zygote: After code cache collection, code=109KB, data=44KB
08-21 12:07:29.861 16532-16553/br.com.alura.agenda W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
08-21 12:07:34.859 16532-16559/br.com.alura.agenda V/FA: Inactivity, disconnecting from the service
8 respostas

Oi Walderi, blz?

A princípio eu não vejo nenhuma mensagem de erro do seu projeto, portanto, não tenho a real certeza do que está acontecendo. Entretanto, podemos fazer alguns testes para verificar o que aconteceu.

A primeira delas é justamente verificar se você criou a classe AgendaInstanceIDService da seguinte maneira:

public class AgendaInstanceIDService extends FirebaseInstanceIdService {

    public void OnTokenRefresh(){
        String refreshedToken = FirebaseInstanceId.getInstance().getToken();
        Log.d(TAG, "Refreshed token: " + refreshedToken);
    }

Caso ela tenha sido criada, verifique se ela foi declarada como serviço no manifest da seguinte maneira:

 <service android:name=".firebase.AgendaInstanceIDService">
    <intent-filter>
        <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
    </intent-filter>
</service>

Se tudo estiver de acordo, recomendo que baixe novamente o arquivo google-services.json no console do Firebase, você pode encontrá-lo nas configurações do projeto que fica localizado em um ícone de engrenagem. Após baixá-lo, basta apenas adicioná-lo no módulo app do projeto, se já existir esse arquivo (provavelmente vai existir seguindo a configuração da aula), pode substituí-lo. Então, desinstale novamente a aplicação e execute novamente. Veja se funciona.

Se tiver acontecendo algum problema de build, ou, se aparecer alguma mensagem de erro, por favor me avise. Também, se for o caso, me manda o código que fez que eu posso dar uma olhada no que aconteceu.

Qualquer dúvida fique à vontade em perguntar.

[]s

Ainda com erro

08-21 13:35:26.869 27813-27813/? I/zygote: Not late-enabling -Xcheck:jni (already on)
08-21 13:35:26.880 27813-27813/? W/zygote: Unexpected CPU variant for X86 using defaults: x86
08-21 13:35:27.191 27813-27852/br.com.alura.agenda W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
08-21 13:35:27.197 27813-27813/br.com.alura.agenda W/InstanceID/Rpc: Found 10012
08-21 13:35:27.203 27813-27852/br.com.alura.agenda W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
08-21 13:35:27.321 27813-27813/br.com.alura.agenda I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
08-21 13:35:27.322 27813-27813/br.com.alura.agenda I/DynamiteModule: Selected local version of com.google.android.gms.flags
08-21 13:35:27.331 27813-27813/br.com.alura.agenda W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
08-21 13:35:27.338 27813-27813/br.com.alura.agenda I/DynamiteModule: Considering local module com.google.android.gms.crash:0 and remote module com.google.android.gms.crash:4
08-21 13:35:27.338 27813-27813/br.com.alura.agenda I/DynamiteModule: Selected remote version of com.google.android.gms.crash, version >= 4
08-21 13:35:27.339 27813-27813/br.com.alura.agenda W/zygote: Skipping duplicate class check due to unrecognized classloader
08-21 13:35:27.351 27813-27813/br.com.alura.agenda W/zygote: Skipping duplicate class check due to unrecognized classloader
08-21 13:35:27.358 27813-27813/br.com.alura.agenda I/FirebaseCrashApiImpl: FirebaseCrashApiImpl created by ClassLoader p[DexPathList[[zip file "/system/priv-app/PrebuiltGmsCore/app_chimera/m/DynamiteModulesC.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/00000003/n/x86, /system/lib, /system/vendor/lib]]]
08-21 13:35:27.368 27813-27813/br.com.alura.agenda I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
08-21 13:35:27.368 27813-27813/br.com.alura.agenda I/DynamiteModule: Selected local version of com.google.android.gms.flags
08-21 13:35:27.371 27813-27813/br.com.alura.agenda W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
08-21 13:35:27.393 27813-27813/br.com.alura.agenda I/FA: App measurement is starting up, version: 10084
08-21 13:35:27.393 27813-27813/br.com.alura.agenda I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
08-21 13:35:27.394 27813-27813/br.com.alura.agenda D/FA: Debug-level message logging enabled
08-21 13:35:27.394 27813-27813/br.com.alura.agenda D/FA: AppMeasurement singleton hash: 77826196
08-21 13:35:27.401 27813-27813/br.com.alura.agenda V/FA: Collection enabled
08-21 13:35:27.401 27813-27813/br.com.alura.agenda V/FA: App package, google app id: br.com.alura.agenda, 1:870642785316:android:3a5ad5bdb69d3b6a
08-21 13:35:27.401 27813-27813/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
08-21 13:35:27.419 27813-27813/br.com.alura.agenda V/FA: Registered activity lifecycle callback
08-21 13:35:27.420 27813-27813/br.com.alura.agenda I/FirebaseCrash: FirebaseCrash reporting initialized com.google.android.gms.internal.zzbks@c02332
08-21 13:35:27.420 27813-27813/br.com.alura.agenda I/FirebaseInitProvider: FirebaseApp initialization successful
08-21 13:35:27.422 27813-27813/br.com.alura.agenda I/InstantRun: starting instant run server: is main process
08-21 13:35:27.423 27813-27858/br.com.alura.agenda V/FA: State of service unknown
08-21 13:35:27.423 27813-27858/br.com.alura.agenda V/FA: Checking service availability
08-21 13:35:27.430 27813-27858/br.com.alura.agenda V/FA: Service available
08-21 13:35:27.431 27813-27858/br.com.alura.agenda V/FA: Setting useService: true
08-21 13:35:27.434 27813-27858/br.com.alura.agenda V/FA: Using measurement service
08-21 13:35:27.434 27813-27858/br.com.alura.agenda V/FA: Connecting to remote service
08-21 13:35:27.490 27813-27813/br.com.alura.agenda V/FA: onActivityCreated
08-21 13:35:27.581 27813-27813/br.com.alura.agenda W/nAnnotationIntrospector: Unable to load JDK7 annotation types; will have to skip
08-21 13:35:27.616 27813-27813/br.com.alura.agenda D/NetworkSecurityConfig: No Network Security Config specified, using platform default
08-21 13:35:27.655 27813-27819/br.com.alura.agenda I/zygote: Do partial code cache collection, code=30KB, data=20KB
08-21 13:35:27.655 27813-27819/br.com.alura.agenda I/zygote: After code cache collection, code=30KB, data=20KB
08-21 13:35:27.655 27813-27819/br.com.alura.agenda I/zygote: Increasing code cache capacity to 128KB
08-21 13:35:27.665 27813-27868/br.com.alura.agenda D/OkHttp: --> GET http://10.0.2.2:8080/api/aluno http/1.1
08-21 13:35:27.665 27813-27868/br.com.alura.agenda D/OkHttp: --> END GET
08-21 13:35:27.666 27813-27858/br.com.alura.agenda V/FA: Using measurement service
08-21 13:35:27.666 27813-27858/br.com.alura.agenda V/FA: Connection attempt already in progress
08-21 13:35:27.666 27813-27858/br.com.alura.agenda V/FA: Activity resumed, time: 6179066
08-21 13:35:27.682 27813-27872/br.com.alura.agenda D/OpenGLRenderer: HWUI GL Pipeline
08-21 13:35:27.731 27813-27872/br.com.alura.agenda I/OpenGLRenderer: Initialized EGL, version 1.4
08-21 13:35:27.731 27813-27872/br.com.alura.agenda D/OpenGLRenderer: Swap behavior 1
08-21 13:35:27.732 27813-27872/br.com.alura.agenda W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
08-21 13:35:27.732 27813-27872/br.com.alura.agenda D/OpenGLRenderer: Swap behavior 0
08-21 13:35:27.734 27813-27872/br.com.alura.agenda D/EGL_emulation: eglCreateContext: 0x9fe053c0: maj 3 min 1 rcv 4
08-21 13:35:27.736 27813-27872/br.com.alura.agenda D/EGL_emulation: eglMakeCurrent: 0x9fe053c0: ver 3 1 (tinfo 0x9fe032c0)
08-21 13:35:27.739 27813-27872/br.com.alura.agenda E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
08-21 13:35:27.739 27813-27872/br.com.alura.agenda E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
08-21 13:35:27.739 27813-27872/br.com.alura.agenda E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824


                                                                     [ 08-21 13:35:27.769 27813:27872 D/         ]
                                                                     SurfaceInterface::setAsyncMode: set async mode 1
08-21 13:35:27.790 27813-27872/br.com.alura.agenda D/EGL_emulation: eglMakeCurrent: 0x9fe053c0: ver 3 1 (tinfo 0x9fe032c0)
08-21 13:35:27.865 27813-27858/br.com.alura.agenda D/FA: Connected to remote service
08-21 13:35:27.865 27813-27858/br.com.alura.agenda V/FA: Processing queued up service tasks: 2
08-21 13:35:28.356 27813-27858/br.com.alura.agenda W/zygote: Long monitor contention with owner pool-3-thread-1 (27873) at long com.android.org.conscrypt.NativeCrypto.RSA_generate_key_ex(int, byte[])(NativeCrypto.java:-2) waiters=0 in java.security.KeyPair com.google.firebase.iid.zzh.zzeM(java.lang.String) for 456ms
08-21 13:35:28.503 27813-27868/br.com.alura.agenda D/OkHttp: <-- 200 OK http://10.0.2.2:8080/api/aluno (837ms)
08-21 13:35:28.503 27813-27868/br.com.alura.agenda D/OkHttp: Server: Apache-Coyote/1.1
08-21 13:35:28.503 27813-27868/br.com.alura.agenda D/OkHttp: Content-Type: application/json;charset=UTF-8
08-21 13:35:28.503 27813-27868/br.com.alura.agenda D/OkHttp: Transfer-Encoding: chunked
08-21 13:35:28.503 27813-27868/br.com.alura.agenda D/OkHttp: Date: Mon, 21 Aug 2017 17:35:42 GMT
08-21 13:35:28.503 27813-27868/br.com.alura.agenda D/OkHttp: {"alunos":[{"id":"29e0c1ff-89b9-46bd-b3ae-f37d494630bc","nome":"DoSite","endereco":"Ali","telefone":"121313121241","site":"oxenteparaguiaiiiiii","nota":10.0,"desativado":0,"idCliente":0},{"id":"443b4b6c-cd98-4be6-980c-ebe4901386a5","nome":"Regivaldo","endereco":"asdasdasdasdq","telefone":"1111111111111","site":"sdasdasdasd","nota":0.0,"desativado":0,"idCliente":0},{"id":"7ba1c300-e1f9-4f1f-b440-091e3e73ab76","nome":"Walderi","endereco":"Rua Abilio Alencar","telefone":"92992096956","site":"walderi.filho@itriad.org.br","nota":10.0,"desativado":0,"idCliente":1},{"id":"84d7a6ae-6ac6-44c3-b970-9af278de661a","nome":"Orlando","endereco":"aaa","telefone":"12311412","site":"afkdjf","nota":0.0,"desativado":0,"idCliente":0}],"momentoDaUltimaModificacao":"2017-08-21T13:35:42.973"}
08-21 13:35:28.503 27813-27868/br.com.alura.agenda D/OkHttp: <-- END HTTP (779-byte body)
08-21 13:35:28.517 27813-27813/br.com.alura.agenda I/id do aluno:: 29e0c1ff-89b9-46bd-b3ae-f37d494630bc
08-21 13:35:28.517 27813-27813/br.com.alura.agenda I/id do aluno:: 443b4b6c-cd98-4be6-980c-ebe4901386a5
08-21 13:35:28.517 27813-27813/br.com.alura.agenda I/id do aluno:: 7ba1c300-e1f9-4f1f-b440-091e3e73ab76
08-21 13:35:28.517 27813-27813/br.com.alura.agenda I/id do aluno:: 84d7a6ae-6ac6-44c3-b970-9af278de661a
08-21 13:35:28.567 27813-27819/br.com.alura.agenda I/zygote: Do partial code cache collection, code=41KB, data=57KB
08-21 13:35:28.567 27813-27819/br.com.alura.agenda I/zygote: After code cache collection, code=41KB, data=57KB
08-21 13:35:28.567 27813-27819/br.com.alura.agenda I/zygote: Increasing code cache capacity to 256KB
08-21 13:35:28.567 27813-27819/br.com.alura.agenda I/zygote: JIT allocated 71KB for compiled code of void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int)
08-21 13:35:28.567 27813-27819/br.com.alura.agenda I/zygote: Compiler allocated 4MB to compile void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int)
08-21 13:35:33.360 27813-27858/br.com.alura.agenda V/FA: Inactivity, disconnecting from the service
08-21 13:35:37.668 27813-27858/br.com.alura.agenda V/FA: Session started, time: 6189067
08-21 13:35:37.693 27813-27858/br.com.alura.agenda I/DynamiteModule: Considering local module com.google.android.gms.tagmanager:8 and remote module com.google.android.gms.tagmanager:9
08-21 13:35:37.693 27813-27858/br.com.alura.agenda I/DynamiteModule: Selected remote version of com.google.android.gms.tagmanager, version >= 9
08-21 13:35:37.702 27813-27858/br.com.alura.agenda W/GoogleTagManager: No container asset found in /assets/containers. Checking top level /assets directory for container assets.
08-21 13:35:37.704 27813-27858/br.com.alura.agenda W/GoogleTagManager: Tag Manager's event handler WILL NOT be installed (no container loaded)
08-21 13:35:37.704 27813-27858/br.com.alura.agenda I/GoogleTagManager: Tag Manager initilization took 5ms
08-21 13:35:37.704 27813-27858/br.com.alura.agenda D/FA: Logging event (FE): _s, Bundle[{_o=auto, _sc=ListaAlunosActivity, _si=-8005257488885824971}]
08-21 13:35:37.715 27813-27858/br.com.alura.agenda V/FA: Using measurement service
08-21 13:35:37.715 27813-27858/br.com.alura.agenda V/FA: Connecting to remote service
08-21 13:35:37.722 27813-27858/br.com.alura.agenda D/FA: Connected to remote service
08-21 13:35:37.722 27813-27858/br.com.alura.agenda V/FA: Processing queued up service tasks: 1
08-21 13:35:37.724 27813-27819/br.com.alura.agenda I/zygote: Do full code cache collection, code=125KB, data=65KB
08-21 13:35:37.724 27813-27819/br.com.alura.agenda I/zygote: After code cache collection, code=109KB, data=44KB
08-21 13:35:37.769 27813-27852/br.com.alura.agenda W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
08-21 13:35:42.733 27813-27858/br.com.alura.agenda V/FA: Inactivity, disconnecting from the service

Talvez seja por causa dos meus imports

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '25.0.0'
    defaultConfig {
        applicationId "br.com.alura.agenda"
        minSdkVersion 23
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
    packagingOptions {
        exclude "META-INF/LICENSE"
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile 'com.android.support:cardview-v7:23.3.0'
    compile 'com.android.support:support-v4:23.3.0'
    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    compile 'com.squareup.retrofit2:converter-jackson:2.3.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile 'com.google.android.gms:play-services:10.0.1'
}


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

Tive alguns problemas de compatibilidade entre o play-services e o firebase mais cedo, e resolvi mudando a versão do play service

A princípio não vejo problema na sua configuração. Podemos fazer o seguinte, você pode subir o projeto em um github e me manda o link para eu dar uma olhada. Assim eu baixo e executo pra vê o que acontece, o que acha?

solução!

Opa Walderi, acabei de verificar aqui. Modifiquei para o json do meu projeto e modifiquei a classe AgendaInstanceIDService com o seguinte código:

    @Override
    public void onTokenRefresh() {
        String refreshedToken = FirebaseInstanceId.getInstance().getToken();
        Log.d("token", refreshedToken);

        enviaTokenParaservidor(refreshedToken);
    }

Antes estava usando um método que não estava sobrescrevendo o onTokenRefresh(), ele estava usando o OnTokenRefresh(), por isso não entrava nesse método. Pode modificar essa classe e verificar se funciona?

[]s

Se for de auxilio quando eu envio uma mensagem pelo console do Firebase o log emite essas mensagens:

08-21 15:11:22.272 27813-27823/br.com.alura.agenda I/zygote: Waiting for a blocking GC ObjectsAllocated
08-21 15:11:22.287 27813-27823/br.com.alura.agenda I/zygote: Waiting for a blocking GC ObjectsAllocated
08-21 15:11:22.287 27813-27823/br.com.alura.agenda I/zygote: WaitForGcToComplete blocked for 15.166ms for cause ObjectsAllocated
08-21 15:56:02.929 27813-20252/br.com.alura.agenda D/FA: Logging event (FE): _nr, Bundle[{_o=fcm, _sc=ListaAlunosActivity, _si=-8005257488885824971, _ndt=0, _nmn=aaaaaaaiiiiiiii, _nmt=1503345402, _nmid=8163742390751596617}]
08-21 15:56:02.937 27813-20252/br.com.alura.agenda V/FA: Using measurement service
08-21 15:56:02.937 27813-20252/br.com.alura.agenda V/FA: Connecting to remote service
08-21 15:56:02.949 27813-20252/br.com.alura.agenda D/FA: Logging event (FE): _nf, Bundle[{_o=fcm, _sc=ListaAlunosActivity, _si=-8005257488885824971, _ndt=0, _nmn=aaaaaaaiiiiiiii, _nmt=1503345402, _nmid=8163742390751596617}]
08-21 15:56:02.964 27813-20252/br.com.alura.agenda V/FA: Using measurement service
08-21 15:56:02.964 27813-20252/br.com.alura.agenda V/FA: Connection attempt already in progress
08-21 15:56:02.965 27813-20252/br.com.alura.agenda D/FA: Connected to remote service
08-21 15:56:02.965 27813-20252/br.com.alura.agenda V/FA: Processing queued up service tasks: 2
08-21 15:56:08.000 27813-20252/br.com.alura.agenda V/FA: Inactivity, disconnecting from the service

Não resolveu

A solução foi retornar a versão da biblioteca do firebase e do google play

compile 'com.google.firebase:firebase-messaging:9.0.0'
compile 'com.google.android.gms:play-services:9.0.0'

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software