{ "id": "171422", "key": "AC-5683", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2018-04-17T21:19:49.000+0000", "created": "2018-03-29T12:07:57.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2020-03-16T12:49:45.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14551", "name": "Studio", "description": "Please enter tickets related to Titanium Studio here." }, { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "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?*\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java\r\n\r\n{quote}\r\njava.lang.RuntimeException: \r\n at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2981)\r\n at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3042)\r\n at android.app.ActivityThread.-wrap14 (ActivityThread.java)\r\n at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1639)\r\n at android.os.Handler.dispatchMessage (Handler.java:102)\r\n at android.os.Looper.loop (Looper.java:154)\r\n at android.app.ActivityThread.main (ActivityThread.java:6776)\r\n at java.lang.reflect.Method.invoke (Native Method)\r\n at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1520)\r\n at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1410)\r\nCaused by: java.lang.ClassCastException: \r\n at org.appcelerator.titanium.TiBaseActivity.getTiApp (TiBaseActivity.java:248)\r\n at org.appcelerator.titanium.TiRootActivity.onCreate (TiRootActivity.java:78)\r\n at android.app.Activity.performCreate (Activity.java:6955)\r\n at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1126)\r\n at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2924)\r\n{quote}", "attachment": [], "flagged": false, "summary": "Android: Getting crash report from google", "creator": { "name": "sonufana4u", "key": "sonufana4u", "displayName": "sonufana4u", "active": true, "timeZone": "Asia/Kolkata" }, "subtasks": [], "reporter": { "name": "sonufana4u", "key": "sonufana4u", "displayName": "sonufana4u", "active": true, "timeZone": "Asia/Kolkata" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.13.1\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 8589934592\r\nNode.js\r\n Node.js Version = 8.9.3\r\n npm Version = 5.5.1\r\nTitanium CLI\r\n CLI Version = 5.0.14\r\nTitanium SDK\r\n SDK Version = 7.0.1.GA", "comment": { "comments": [ { "id": "436080", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I am wondering if this also happens with currnet versions of the SDK, like 7.1.0.GA. [~ybanev] did you see this before?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-03-29T14:15:10.000+0000", "updated": "2018-03-29T14:15:10.000+0000" }, { "id": "436096", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "Doesn't ring any bell. \r\n[~sonufana4u] Any details you can share - code snippet you are suspecting, device, Android version ?", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2018-03-29T15:51:18.000+0000", "updated": "2018-03-29T15:51:18.000+0000" }, { "id": "436125", "author": { "name": "sonufana4u", "key": "sonufana4u", "displayName": "sonufana4u", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Right now i don't have any info with me but i'll try to share as much as info i could collect.", "updateAuthor": { "name": "sonufana4u", "key": "sonufana4u", "displayName": "sonufana4u", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2018-03-30T05:40:17.000+0000", "updated": "2018-03-30T05:40:17.000+0000" }, { "id": "436157", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~sonufana4u], Did you manage to collect more information?", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2018-04-01T10:05:11.000+0000", "updated": "2018-04-01T10:05:11.000+0000" }, { "id": "436165", "author": { "name": "sonufana4u", "key": "sonufana4u", "displayName": "sonufana4u", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Hello Mostafizur,\r\n\r\nNot yet. Due to long weekend am not able to collect info.Will share with you soon.Thanks", "updateAuthor": { "name": "sonufana4u", "key": "sonufana4u", "displayName": "sonufana4u", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2018-04-02T04:48:54.000+0000", "updated": "2018-04-02T04:48:54.000+0000" }, { "id": "436172", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~sonufana4u],Ok. Thanks. We will be waiting for that.", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2018-04-02T08:47:19.000+0000", "updated": "2018-04-02T08:47:19.000+0000" }, { "id": "436828", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~sonufana4u],\r\n\r\nDid you manage to collect more information? We are waiting for that.\r\nThanks", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2018-04-12T11:28:50.000+0000", "updated": "2018-04-12T11:28:50.000+0000" }, { "id": "436858", "author": { "name": "sonufana4u", "key": "sonufana4u", "displayName": "sonufana4u", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Hi Mostafizur,\r\n\r\nI 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.", "updateAuthor": { "name": "sonufana4u", "key": "sonufana4u", "displayName": "sonufana4u", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2018-04-13T06:56:29.000+0000", "updated": "2018-04-13T06:56:29.000+0000" }, { "id": "436884", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Please share a sample reproducible code for us to test. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-04-13T21:22:02.000+0000", "updated": "2018-04-13T21:22:02.000+0000" }, { "id": "438165", "author": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "body": "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])\r\nI think this should fix it:\r\n\r\n{code:java}\r\n--- a/android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java\r\n+++ b/android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java\r\n@@ -263,7 +263,7 @@ public abstract class TiBaseActivity extends AppCompatActivity\r\n */\r\n public TiApplication getTiApp()\r\n {\r\n- return (TiApplication) getApplication();\r\n+ return TiApplication.getInstance();\r\n }\r\n{code}\r\n", "updateAuthor": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "created": "2018-06-06T09:02:24.000+0000", "updated": "2018-06-06T09:02:24.000+0000" }, { "id": "442342", "author": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "body": "I saw similar issues in my app using SDK 6.3.1.\r\n\r\nI have now patched the SDK to use this code:\r\n{code:java}\r\n\t\tTiApplication ta = (TiApplication) getApplication();\r\n\t\tif(null == ta) {\r\n\t\t Log.e(\"Error\", \"TiApplication null. Try to load instance...\");\r\n\t\t\tta = TiApplication.getInstance();\r\n\t\t}\r\n\t\treturn ta;\r\n{code}\r\nI 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.\r\n\r\nBy the way I also checked the code in the lates SDK 7.4.1 - and it still uses:\r\n\r\n{code:java}\r\n\treturn (TiApplication) getApplication();\r\n{code}", "updateAuthor": { "name": "jda", "key": "jda", "displayName": "John Dalsgaard", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-10-05T13:32:23.000+0000", "updated": "2018-10-05T13:38:07.000+0000" }, { "id": "442343", "author": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "body": "Please use \"preview\" button (blue button with 3 stripes below comment block). You've just produced over 10 emails.\r\nStrip spaces before/after braces:\r\n{ code:java }CODE HERE{ code }", "updateAuthor": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "created": "2018-10-05T13:38:04.000+0000", "updated": "2018-10-05T13:38:04.000+0000" }, { "id": "443354", "author": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "body": "So, this does not help:\r\n{code:java}\r\n- return (TiApplication) getApplication();\r\n+ return TiApplication.getInstance();\r\n{code}\r\nNow I got NullPointerExceptions, because somehow there is no {{TiApplication}} instance at the moment when {{TiRootActivity.onCreate}} executed.\r\nAs before reports are coming only from Android 7.0 (and some 7.1) and I still have no idea how to reproduce it localy.", "updateAuthor": { "name": "s.volkov", "key": "s.volkov", "displayName": "Sergey Volkov", "active": true, "timeZone": "Europe/Moscow" }, "created": "2018-11-07T09:05:50.000+0000", "updated": "2018-11-07T09:05:50.000+0000" }, { "id": "448588", "author": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "This is not resolved. Got the same crash on Huawei Mate 10 Pro with Android 9:\r\n{noformat}\r\njava.lang.RuntimeException: \r\n at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3300)\r\n at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3484)\r\n at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:86)\r\n at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:108)\r\n at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:68)\r\n at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2123)\r\n at android.os.Handler.dispatchMessage (Handler.java:109)\r\n at android.os.Looper.loop (Looper.java:207)\r\n at android.app.ActivityThread.main (ActivityThread.java:7470)\r\n at java.lang.reflect.Method.invoke (Native Method)\r\n at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:524)\r\n at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:958)\r\nCaused by: java.lang.ClassCastException: \r\n at org.appcelerator.titanium.TiBaseActivity.getTiApp (TiBaseActivity.java:308)\r\n at org.appcelerator.titanium.TiRootActivity.onCreate (TiRootActivity.java:80)\r\n at android.app.Activity.performCreate (Activity.java:7436)\r\n at android.app.Activity.performCreate (Activity.java:7426)\r\n at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1286)\r\n at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3279)\r\n{noformat}", "updateAuthor": { "name": "buddyguards", "key": "buddyguards", "displayName": "grebulon", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2019-05-22T09:22:51.000+0000", "updated": "2019-05-22T09:23:44.000+0000" }, { "id": "454707", "author": { "name": "mj", "key": "mj", "displayName": "martin", "active": true, "timeZone": "Europe/Berlin" }, "body": "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:\r\n{code}\r\njava.lang.RuntimeException: \r\n at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3108)\r\n at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3251)\r\n at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:78)\r\n at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:108)\r\n at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:68)\r\n at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1948)\r\n at android.os.Handler.dispatchMessage (Handler.java:106)\r\n at android.os.Looper.loop (Looper.java:214)\r\n at android.app.ActivityThread.main (ActivityThread.java:7045)\r\n at java.lang.reflect.Method.invoke (Native Method)\r\n at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)\r\n at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:964)\r\nCaused by: java.lang.ClassCastException: \r\n at org.appcelerator.titanium.TiBaseActivity.getTiApp (TiBaseActivity.java:225)\r\n at org.appcelerator.titanium.TiBaseActivity.finish (TiBaseActivity.java:1763)\r\n at org.appcelerator.titanium.TiActivity.onCreate (TiActivity.java:42)\r\n at android.app.Activity.performCreate (Activity.java:7327)\r\n at android.app.Activity.performCreate (Activity.java:7318)\r\n at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1271)\r\n at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3088)\r\n{code}", "updateAuthor": { "name": "mj", "key": "mj", "displayName": "martin", "active": true, "timeZone": "Europe/Berlin" }, "created": "2020-03-16T12:49:45.000+0000", "updated": "2020-03-16T12:49:45.000+0000" } ], "maxResults": 15, "total": 15, "startAt": 0 } } }