[AC-5683] Android: Getting crash report from google
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Needs more info |
Resolution Date | 2018-04-17T21:19:49.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Studio, Titanium SDK & CLI |
Labels | n/a |
Reporter | sonufana4u |
Assignee | Shak Hossain |
Created | 2018-03-29T12:07:57.000+0000 |
Updated | 2020-03-16T12:49:45.000+0000 |
Description
*Getting crash report from google but don't know how to prevent that.Found below link where its causing the issue at line 258.So how to handle in my application?*
https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java
{quote}
java.lang.RuntimeException:
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2981)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3042)
at android.app.ActivityThread.-wrap14 (ActivityThread.java)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1639)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:154)
at android.app.ActivityThread.main (ActivityThread.java:6776)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1410)
Caused by: java.lang.ClassCastException:
at org.appcelerator.titanium.TiBaseActivity.getTiApp (TiBaseActivity.java:248)
at org.appcelerator.titanium.TiRootActivity.onCreate (TiRootActivity.java:78)
at android.app.Activity.performCreate (Activity.java:6955)
at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1126)
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2924)
{quote}
I am wondering if this also happens with currnet versions of the SDK, like 7.1.0.GA. [~ybanev] did you see this before?
Doesn't ring any bell. [~sonufana4u] Any details you can share - code snippet you are suspecting, device, Android version ?
Right now i don't have any info with me but i'll try to share as much as info i could collect.
[~sonufana4u], Did you manage to collect more information?
Hello Mostafizur, Not yet. Due to long weekend am not able to collect info.Will share with you soon.Thanks
[~sonufana4u],Ok. Thanks. We will be waiting for that.
Hello [~sonufana4u], Did you manage to collect more information? We are waiting for that. Thanks
Hi Mostafizur, I didn't get much info but this is happening on Android 7 & Samsung Galaxy S7 edge and Galaxy S8.Check at your end and let me know if it helps to identify the issue.
Hello, Please share a sample reproducible code for us to test. Thanks.
Got same issue. Looks like it is not Titanium specific, but Android 7+. ([stackoverflow](https://stackoverflow.com/questions/44840768/android-7-0-and-7-1-getapplication-classcastexception/46676931)) I think this should fix it:
I saw similar issues in my app using SDK 6.3.1. I have now patched the SDK to use this code:
I cannot find a very to directly reproduce this - but I should know within a month or two whether it has removed this type of crashes by looking at the Google Play console. By the way I also checked the code in the lates SDK 7.4.1 - and it still uses:
Please use "preview" button (blue button with 3 stripes below comment block). You've just produced over 10 emails. Strip spaces before/after braces: { code:java }CODE HERE{ code }
So, this does not help:
Now I got NullPointerExceptions, because somehow there is no
TiApplication
instance at the moment whenTiRootActivity.onCreate
executed. As before reports are coming only from Android 7.0 (and some 7.1) and I still have no idea how to reproduce it localy.This is not resolved. Got the same crash on Huawei Mate 10 Pro with Android 9: {noformat} java.lang.RuntimeException: at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3300) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3484) at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:86) at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2123) at android.os.Handler.dispatchMessage (Handler.java:109) at android.os.Looper.loop (Looper.java:207) at android.app.ActivityThread.main (ActivityThread.java:7470) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:958) Caused by: java.lang.ClassCastException: at org.appcelerator.titanium.TiBaseActivity.getTiApp (TiBaseActivity.java:308) at org.appcelerator.titanium.TiRootActivity.onCreate (TiRootActivity.java:80) at android.app.Activity.performCreate (Activity.java:7436) at android.app.Activity.performCreate (Activity.java:7426) at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1286) at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3279) {noformat}
Same here, using SDK 8.3.1.GA and seen on LGE LG Q6 (mhn) with Android 8.1 and Samsung Galaxy S8 (dreamlte) with Android 9: