Android Question Interpreting Google's Pre-launch Reports

CaptKronos

Active Member
Licensed User
Hi All,

I'm seeking some guidance on how to interpret Google's pre-launch reports. Usually a crash is clearly related to my app and the report provides sufficient information for me to fix the problem. However sometimes the cause of a crash is not so obvious. For example, what might be the cause of the following three, separate, crashes? (Zoetic is the name of my app.) What I think I am after is guidance on whether I should aim to get rid of all such occurrences or whether I should accept that such crashes are in the "lap of the gods". Googling this question seems to suggest the latter.

Issue: java.lang.OutOfMemoryError: Failed to allocate a 1048588 byte allocation with 647904 free bytes and 632KB until OOM

Issue: java.lang.RuntimeException: An error occured while executing doInBackground()

Issue: Native crash of uk.cyferltd.zoetic

Also, the pre-launch report only indicates that the device running the "Native crash" has an issue. The other two devices get a green tick despite reporting the crashes.
 

CaptKronos

Active Member
Licensed User
Hi Peter, thanks for looking into this.

B4X:
Issue: java.lang.OutOfMemoryError: Failed to allocate a 1048588 byte allocation with 647904 free bytes and 632KB until OOM  
FATAL EXCEPTION: main
Process: com.android.vending, PID: 12216
java.lang.OutOfMemoryError: Failed to allocate a 1048588 byte allocation with 647904 free bytes and 632KB until OOM
    at java.util.HashMap.inflateTable(HashMap.java:287)
    at java.util.HashMap.<init>(HashMap.java:255)
    at android.app.SharedPreferencesImpl$EditorImpl.commitToMemory(SharedPreferencesImpl.java:402)
    at android.app.SharedPreferencesImpl$EditorImpl.apply(SharedPreferencesImpl.java:362)
    at com.google.android.finsky.ag.q.a(SourceFile:11)
    at com.google.android.finsky.ee.d.b_(Unknown Source)
    at com.google.android.finsky.api.a.cp.a(SourceFile:700)
    at com.android.volley.i.run(SourceFile:10)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:241)
    at android.app.ActivityThread.main(ActivityThread.java:6281)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

B4X:
Issue: java.lang.RuntimeException: An error occured while executing doInBackground()
FATAL EXCEPTION: AsyncTask #1
Process: com.android.vending, PID: 23347
java.lang.RuntimeException: An error occured while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:304)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack available

B4X:
Issue: Native crash of uk.cyferltd.zoetic
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'HUAWEI/MHA-L29/HWMHA:7.0/HUAWEIMHA-L29/C567B138:user/release-keys'
Revision: '0'
ABI: 'arm'
pid: 19535, tid: 19585, name: ControllerMesse  >>> uk.cyferltd.zoetic <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'Cannot get a dirty matrix!'
    r0 00000000  r1 00004c81  r2 00000006  r3 00000008
    r4 d2288978  r5 00000006  r6 d2288920  r7 0000010c
    r8 12cc3a60  r9 e5679200  sl cf54a490  fp ffffffff
    ip 0000000b  sp d2286ce0  lr f1992a37  pc f19952a0  cpsr 000b0010
backtrace:
    #00 pc 0004a2a0  /system/lib/libc.so (tgkill+12)
    #01 pc 00047a33  /system/lib/libc.so (pthread_kill+34)
    #02 pc 0001d925  /system/lib/libc.so (raise+10)
    #03 pc 00019471  /system/lib/libc.so (__libc_android_abort+34)
    #04 pc 000170b4  /system/lib/libc.so (abort+4)
    #05 pc 0000d15b  /vendor/lib/libcutils.so (__android_log_assert+114)
    #06 pc 0008d1d1  /system/lib/libandroid_runtime.so
    #07 pc 74753d23  /data/dalvik-cache/arm/system@[email protected] (offset 0x17c6000)
 
Upvote 0

CaptKronos

Active Member
Licensed User
I'm not using Volley. (I had to Google to find out what it is.) However I am using the Threading library to download files for no other reason than to make the user interface more responsive when downloading large files.

B4X:
private Sub copyFileThread_Sub(UriStringO As Object, joO As Object, destO As Object)
    Dim UriString As String=UriStringO
    Dim jo As JavaObject=joO
    Dim dest As DirAndFilename=destO
    Try
        Dim AnIS As InputStream = File.OpenInput(jo.GetField("ContentDir"), UriString) 'interface freezes
        Dim out As OutputStream = File.OpenOutput(dest.Dir,dest.Filename,False)
        File.Copy2(AnIS, out)
        out.Close
        AnIS.Close
        copyFileThreadSuccess=True
    Catch
        copyFileThreadSuccess=False
        Log("Warning 2427: " & LastException)
    End Try
End Sub

Interestingly, the little videos that are included in the pre-launch report don't show any crashes and also don't show the parts of my app being called that would use the above code.
 
Upvote 0

CaptKronos

Active Member
Licensed User
That's weird. The File.Copy2(AnIS, out) command freezes the GUI for me whereas running the command on a separate thread everything continues smoothly. I have a spinning ProgressWheel view shown during the download and the difference between the two approaches is very noticeably. It is also only possible for the user to cancel the download if a separate thread is used.
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Watch this video and also this video
You will learn a lot from them an just watching them should help you with your issues, but you really do not need to be using the threading libraries just to make the device more responsive, you should be using Sleep().
 
Upvote 0

CaptKronos

Active Member
Licensed User
I obviously didn't provide sufficient info, the file I'm downloading is one provided through a content provider. (I have a URI string starting "content://".) I believe the usual approach is to use file.copy2 to save the file's content locally?

Reverting back to the original thrust of my question, should I be worried if I am getting any issues being raised in the pre-launch reports, or is it fairly common for non-specific issues to be reported?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
That's weird. The File.Copy2(AnIS, out) command freezes the GUI for me whereas running the command on a separate thread everything continues smoothly.
I've talked about the downloading step. File.Copy or Copy2 will indeed happen on the main thread.

Anyway the error reports do not look related to your app at all.
 
Upvote 0

CaptKronos

Active Member
Licensed User
Thanks Erel. I also note that in other posts you mention that certain functionality is best to test on a real device rather than on an emulator; I assume the Google test environment uses a bank of emulators so the same position would hold about the reliability of the results published in the pre-launch reports.
 
Last edited:
Upvote 0
Top