使用这些更改和重新生成的google-services.json
将正在开发中的应用程序升级到9.0.0:
classpath 'com.google.gms:google-services:3.0.0'
compile 'com.google.android.gms:play-services:9.0.0'
升级后,当应用程序初始化时,预期的logcat消息序列会出现。大约7秒钟后,相同的消息序列会再次输出,并添加了header background_crash
。例如:
17:39:30.162 5453-5453/com.xxx.nub:background_crash I/MultiDex: install done
应用程序在正常情况下运行,直到它被隐藏,例如通过在另一个应用程序中启动活动。5秒钟后,系统检测到应用程序挂起:
05-20 17:40:10.315 5138-5138/com.xxx.nub I/MainActivity: STOP MainActivity
05-20 17:40:10.375 5138-5138/com.xxx.nub I/NubApplication: onTrimMemory(): TRIM_MEMORY_UI_HIDDEN
05-20 17:40:10.375 5138-5138/com.xxx.nub D/FirebaseApp: Notifying background state change listeners.
05-20 17:45:10.465 5138-5143/com.xxx.nub I/dalvikvm: threadid=3: reacting to signal 3
05-20 17:45:10.565 5138-5143/com.xxx.nub I/dalvikvm: Wrote stack traces to '/data/anr/traces.txt'
堆栈跟踪显示该应用程序在 com.google.android.gms.DynamiteModulesC
中挂起。
----- pid 5138 at 2016-05-20 17:45:10 -----
Cmd line: com.xxx.nub
JNI: CheckJNI is off; workarounds are off; pins=0; globals=295
DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0)
"main" prio=5 tid=1 WAIT
| group="main" sCount=1 dsCount=0 obj=0x416c5ea0 self=0x415bb5d0
| sysTid=5138 nice=-11 sched=0/0 cgrp=apps handle=1073844564
| state=S schedstat=( 0 0 0 ) utm=1774 stm=244 core=1
at java.lang.Object.wait(Native Method)
- waiting on <0x42804a68> (a aaf)
at java.lang.Object.wait(Object.java:364)
at aaf.a(:com.google.android.gms.DynamiteModulesC:75)
at zq.onTrimMemory(:com.google.android.gms.DynamiteModulesC:1187)
at android.app.Application.onTrimMemory(Application.java:148)
at com.xxx.nub.NubApplication.onTrimMemory(NubApplication.java:211)
at android.app.ActivityThread.handleTrimMemory(ActivityThread.java:4298)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1481)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5487)
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:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)
该问题出现在运行KitKat操作系统的手机上。该问题不会在运行Lollipop操作系统的手机上出现。
完整的logcat
输出可以在这里查看。
classpath 'com.google.gms:google-services:3.0.0'
仍将包含在项目级别的 gradle 中? - Paula Kristin