Random black screen when launching Android application on device

When I launch my application from the Android studio on the device or when I download and install it from a direct APK file, sometimes there is a black screen , and after a few seconds a request appears with the application crashing a message.

There is no information about this in logcat, except:

Wrote the stack trace in '/data/anr/traces.txt'

So, I opened this file, but I do not understand what I have to look inside it.

Perhaps abstract lines:

----- pid 28645 at 2014-12-12 14:44:02 ----- Cmd line: fr.myapp.www.myapp DALVIK THREADS: (mutexes: tll=0 tsl=0 tscl=0 ghl=0) "main" prio=5 tid=1 MONITOR | group="main" sCount=1 dsCount=0 obj=0x4109b9a0 self=0x4108a450 | sysTid=28645 nice=-11 sched=0/0 cgrp=[fopen-error:2] handle=1074673116 | state=S schedstat=( 0 0 0 ) utm=4 stm=2 core=1 at com.google.android.gms.analytics.ae.getLogger((null):~-1) - waiting to lock <0x41686d38> held by tid=13 (client_id_fetcher) at com.google.android.gms.analytics.ae.W((null):-1) at com.google.android.gms.analytics.z$af((null):-1) at com.google.android.gms.analytics.na((null):-1) at com.google.android.gms.analytics.nx((null):-1) at com.google.android.gms.analytics.GoogleAnalytics.eZ((null):-1) at com.google.android.gms.analytics.GoogleAnalytics.<init>((null):-1) at com.google.android.gms.analytics.GoogleAnalytics.<init>((null):-1) at com.google.android.gms.analytics.GoogleAnalytics.getInstance((null):-1) at fr.myapp.www.myapp.MyAppApplication.getTracker(MyAppApplication.java:36) at fr.myapp.www.myapp.DashboardActivity.onCreate(DashboardActivity.java:41) at android.app.Activity.performCreate(Activity.java:5326) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2225) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2316) at android.app.ActivityThread.access$700(ActivityThread.java:158) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1296) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:176) at android.app.ActivityThread.main(ActivityThread.java:5365) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) at dalvik.system.NativeStart.main(Native Method) 

Maybe I'm wrong, but can these crashes appear in Google Analytics?

Any help with these random glitches?

Thanks;)

+5
source share
2 answers

Same problem. I just updated Google Play Services and I use:

 compile 'com.google.android.gms:play-services-base:6.5.87' compile 'com.google.android.gms:play-services-plus:6.5.87' compile 'com.google.android.gms:play-services-ads:6.5.87' 

I decompiled the code, and it looks like GoogleAnalytics.getInstance() synchronizing with an instance of GoogleAnalytics.class , and there are two more asynchronous streams that use another getter static GoogleAnalytics eY() , which is also synchronized. I cannot understand what is happening (the code is messy), but I think this is a problem in the library.

 DALVIK THREADS (15): "main" prio=5 tid=1 Blocked | group="main" sCount=1 dsCount=0 obj=0x735b82e0 self=0xb8e08530 | sysTid=7921 nice=0 cgrp=apps sched=0/0 handle=0xb6f0bec8 | state=S schedstat=( 0 0 0 ) utm=3 stm=3 core=2 HZ=100 | stack=0xbe590000-0xbe592000 stackSize=8MB | held mutexes= at com.google.android.gms.analytics.ae.getLogger(unavailable:-1) - waiting to lock <0x1c19179f> (a java.lang.Class<com.google.android.gms.analytics.ae>) held by thread 15 at com.google.android.gms.analytics.ae.V(unavailable:-1) at com.google.android.gms.analytics.GoogleAnalytics.a(unavailable:-1) at com.google.android.gms.analytics.GoogleAnalytics.eZ(unavailable:-1) at com.google.android.gms.analytics.GoogleAnalytics.<init>(unavailable:-1) at com.google.android.gms.analytics.GoogleAnalytics.<init>(unavailable:-1) at com.google.android.gms.analytics.GoogleAnalytics.getInstance(unavailable:-1) - locked <0x3fdbb0ec> (a java.lang.Class<com.google.android.gms.analytics.GoogleAnalytics>) ... my application logic at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1011) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4518) at android.app.ActivityThread.access$1500(ActivityThread.java:144) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339) 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) ... other threads "GAThread" prio=5 tid=14 Blocked | group="main" sCount=1 dsCount=0 obj=0x12c8e680 self=0xb90b8f50 | sysTid=7942 nice=10 cgrp=apps/bg_non_interactive sched=0/0 handle=0xb90b9590 | state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=0 HZ=100 | stack=0xa3f4d000-0xa3f4f000 stackSize=1036KB | held mutexes= at com.google.android.gms.analytics.GoogleAnalytics.getInstance(unavailable:-1) - waiting to lock <0x3fdbb0ec> (a java.lang.Class<com.google.android.gms.analytics.GoogleAnalytics>) held by thread 1 at com.google.android.gms.analytics.w.<init>(unavailable:-1) at com.google.android.gms.analytics.x.init(unavailable:-1) - locked <@addr=0x12c8e680> (a com.google.android.gms.analytics.x) at com.google.android.gms.analytics.x.run(unavailable:-1) "client_id_fetcher" prio=5 tid=15 Blocked | group="main" sCount=1 dsCount=0 obj=0x12c24ec0 self=0xb90b9b70 | sysTid=7943 nice=0 cgrp=apps sched=0/0 handle=0xb90ba1b0 | state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=0 HZ=100 | stack=0xa3e43000-0xa3e45000 stackSize=1036KB | held mutexes= at com.google.android.gms.analytics.GoogleAnalytics.eY(unavailable:-1) - waiting to lock <0x3fdbb0ec> (a java.lang.Class<com.google.android.gms.analytics.GoogleAnalytics>) held by thread 1 at com.google.android.gms.analytics.ae.getLogger(unavailable:-1) - locked <0x1c19179f> (a java.lang.Class<com.google.android.gms.analytics.ae>) at com.google.android.gms.analytics.ae.V(unavailable:-1) at com.google.android.gms.analytics.k.eq(unavailable:-1) at com.google.android.gms.analytics.k$1.run(unavailable:-1) - locked <@addr=0x12d3d110> (a java.lang.Object) 

EDIT: The issue is also reported here: https://code.google.com/p/android/issues/detail?id=82157 . Removing the global configuration from the manifest resolved the issue for me.

+5
source

I fixed this problem, but disabled the disconnect of Google Analytics, which I sent.

In our project, we use the boolean value:

 boolean isDeveloperMode = true; // Don't send unless it a public build 

Bug fixed :)

0
source

Source: https://habr.com/ru/post/1208897/


All Articles