升级到Google Play服务9.0.0后,应用程序挂在DynamiteModulesC中 [英] After Upgrading to Google Play Services 9.0.0, App Hangs in DynamiteModulesC
问题描述
使用这些更改将开发中的应用升级到9.0.0,并重新生成 google-services.json
:
classpath'com.google.gms:google-services:3.0.0'
compile'com.google.android.gms:play-services:9.0.0'
升级后,应用程序初始化时,会显示预期的logcat消息序列。大约7秒后,再次输出相同的消息序列,并添加标题 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:通知后台状态更改侦听器。
05-20 17:45:10.465 5138-5143 / com.xxx.nub I / dalvikvm:threadid = 3:对信号3
05-20 17:45:10.565 5138-5143 / com作出反应.xxx.nub I / dalvikvm:将堆栈跟踪写入'/data/anr/traces.txt'
堆栈跟踪显示应用程序挂在 com.google.android.gms.DynamiteModulesC
----- pid 5138 at 2016-05-20 17:45:10 -----
命令行:com.xxx.nub
JNI :CheckJNI关闭;解决方法已关闭;销= 0; globals = 295
DALVIK线程:
(mutexes:tll = 0 tsl = 0 tscl = 0 ghl = 0)
mainprio = 5 tid = 1 WAIT
| group =mainsCount = 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
java.lang.Object.wait(Native Method)
- 等待< 0x42804a68> (aaf)
在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)
在android.os.Handler.dispatchMessage(Handler.java:102)
在android.os.Looper.loop(Looper.java:146)
在android.app.ActivityThread.main(ActivityThread。
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 (本地方法)
在运行KitKat的手机上发生此问题。
完整的 logcat
输出 可以查看此处。
> Firebase崩溃报告。这就是为什么你看到重复的消息,但我不认为它是根本原因。我将把问题归咎于Google Play服务团队的上游问题,但可能有一种解决方法可以同时使用:
因为您'指定 com.google.android.gms:play-services:9.0.0
作为所有Google Play服务中的依赖项 - 这是很多!
我会建议用您需要的特定依赖关系替换该行。您可以在此处找到完整列表。例如,如果您使用Google地图和Google登录,则可以指定:
compile'com.google.android .gms:play-services-auth:9.0.0'
compile'com.google.android.gms:play-services-maps:9.0.0'
Upgraded an app in development to 9.0.0 with these changes and a regeneration of google-services.json
:
classpath 'com.google.gms:google-services:3.0.0'
compile 'com.google.android.gms:play-services:9.0.0'
After upgrade, when the app initializes, the expected sequence of logcat messages appear. After about 7 seconds, the same sequence of messages is output again, with added header background_crash
. For example:
17:39:30.162 5453-5453/com.xxx.nub:background_crash I/MultiDex: install done
The app operates normally until it becomes hidden, for example by starting an activity in another app. After 5 seconds the system detects that the app is hung:
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'
The stack trace shows the app is hung in 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)
The problem occurs on a phone running KitKat. The problem does not occur on a phone running Lollipop.
The complete logcat
output can be viewed here.
The background_crash
process is created by Firebase Crash Reporting. That's why you're seeing the duplicate messages, but I don't think its the root cause here. I'm going to file the hang as an issue upstream with the Google Play services team, but there is probably a workaround you can use in the mean time:
Because you're specifying com.google.android.gms:play-services:9.0.0
as a dependency you're bringing in literally all of Google Play services - which is a lot!
I would recommend replacing that line with the specific dependencies you need. You can find a full list here. As an example, if you're using Maps and Google Sign In, you might specify:
compile 'com.google.android.gms:play-services-auth:9.0.0'
compile 'com.google.android.gms:play-services-maps:9.0.0'
这篇关于升级到Google Play服务9.0.0后,应用程序挂在DynamiteModulesC中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!