Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16538] Android: Analytics crashes App intermittently onResume

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-07-16T18:31:25.000+0000
Affected Version/sRelease 3.2.1
Fix Version/sRelease 3.4.0
ComponentsAndroid
Labelsn/a
ReporterVladimir S
AssigneePing Wang
Created2014-02-02T03:14:08.000+0000
Updated2017-03-16T22:17:06.000+0000

Description

From time to time, when the application is resumed, it does not start. The logcat reveals a stacktrace leading to the Analytics module. Seems like this has been already reported http://developer.appcelerator.com/question/156480/application-crashes-after-a-period-in-the-background-including-services I will try to workaround it by catching the exception, hoping that there are no other dependencies

Attachments

FileDateSize
ANR_reproduction_jay.rtf2014-06-30T20:51:43.000+0000608526
bug_report_out.rtf.zip2014-06-30T20:51:43.000+00002209831
keyDispatchingTimedOutOnForce.rtf2014-06-30T18:21:58.000+0000127907
logsOpeningAppAfterCrash.txt2014-06-05T17:10:10.000+0000215180
logsToCrash.txt2014-06-05T17:10:11.000+0000178633
new 3.txt2014-02-02T03:14:08.000+00006062
PushService-OnForce.rtf2014-06-30T18:21:58.000+0000127927
TiApplication.java2014-02-11T03:47:26.000+000027939
TiBaseActivity.java2014-02-11T03:47:26.000+000040091

Comments

  1. Ritu Agrawal 2014-02-03

    I am curious if you encounter this issue with a specific application or is this issue unrelated to an application? Do you notice this issue under certain circumstances i.e. when the system is running low on memory? I was not able to reproduce this issue with a simple test case.
  2. Vladimir S 2014-02-03

    I cannot reproduce it consistently either... It happens now and then. Just - the last time it happened i was near my computer so i could connect and see the logcat. What i did now is to wrap the coding to catch the exception, to see whether something else wouldn't fail.
  3. Ritu Agrawal 2014-02-09

    Resolving this ticket as "Cannot reproduce" as we have not been able to reproduce the issue in-house. Attached stack trace is also not very helpful as it points to native generic stack. We just don't have enough information at this point to diagnose this issue further. We would be happy to reopen this ticket if you can reproduce it again with more specific use case (for example, device was running low on memory).
  4. Jack Wilson 2014-02-10

    I have a Samsung Galaxy S2, and I am able to reproduce this exact stack trace reliably. This will happen after a random period of time, but it can be caused by either leaving the app in the background with the screen off for a period of time (with no other applications running), or it can happen if using the phone for several other activities. When this happens, the application will disappear from the task manager. If I go to open the app back up, it will open to a black screen, with the application name displayed in a bar up top. This locks up the home button and back button, and eventually Android will ask if I want to kill the app. After this, I can open up the application normally again. Vladimir, were you able to find any sort of temporary solution to prevent this?
  5. Vladimir S 2014-02-11

    Hi Jack, This is exactly the same behavior that I get on my S4. Currently i've tried to try/catch the exception in TiActivity.postanalyticsEvent (See attached source). Yet - it seems like this has reduced the number to crashes, but once it happend again - with no exception visible in the logcat. In an attempt to investigate further - i have added some dumps to TiBaseActivity.onResume. But since then it did not happen again. If you like - you can try those fixes (i simply put the java files in a new project, and all jar files from the SDK in the classpath, build it with JDK 1.6, and then copy the built .class file in the corresponding jar). Another workaround, that i am going to apply once I see the app crashing again - is simply to close it when it goes to background (at least in my case the startup is fast, so it will not kill usability) (i just have to find a reliable way to know that the app is going to pause, and not just a new activity is being open, which causes the main one to go to pause) Regards, Vladimir
  6. Jack Wilson 2014-02-11

    Thanks Vladimir, I'll try with the files you posted and report back. Unfortunately, my application is a messaging app, so for me closing it when it goes to the background isn't an option. And some more information: this issue appeared for me in my most recent release which is using SDK 3.1.3. I've been able to replicate the problem in 3.2.0. Our previous release used SDK 3.1.0, and the issue was not present.
  7. Vladimir S 2014-02-11

    Hi Jack, it is offtopic, but i do not know how to send you a PM - have you considered using Services on Android for this, or using the Notifications API (Google cloud Messaging or Apple Push
  8. Jack Wilson 2014-02-11

    Thank you for the suggestions. We are using push notifications if someone is offline. However, the nature of the application requires rapid response, and push notifications aren't as reliable or as quick as an xmpp message coming in. So that's the main reason for wanting it to stay open in the background, but it's more complicated than just a simple IM client, so there are additional reasons for wanting it to stay open if possible. iOS gave us tons of problems with keeping it open in the background, and Android always just worked (until now). So we may need to reevaluate how we handle Android staying open (we ping iOS devices every minute).
  9. Vladimir S 2014-02-11

    Alright, then - have a look on the workaround. and perhaps if it is easier to reproduce it in the S2, you can see if it really fixes the issue, and if it makes sense to do something in addition
  10. Jack Wilson 2014-02-14

    Vladimir, unfortunately running it with the java files you posted did not correct the issue for me. It didn't display the exception at all in the logs, and went to a completely black screen without even having the application title up top like it used to. I'm thinking that since the app disappears from the task manager when this happens, the exceptions we do see are a result of the problem, not the cause. I'll continue to mess around with it. I'm able to reproduce it in 3.2.1 now also. While it will happen if the app just sits in the background with nothing else going on, using other apps definitely speeds up the process. I've been keeping an eye on memory usage though, and I don't think the device running out of memory is the issue.
  11. Jack Wilson 2014-02-17

    Ritu, Here are some additional details I've found to possibly get this issue reopened. Firstly, the easiest way to identify that the problem has occurred is to have a task manager widget on the main screen of the test device if possible, since the app will disappear from the task manager when the problem occurs. After this happens, opening the app will result in a black screen. DDMS provides no information when this happens. The only indication that something went wrong in the logs, is when you try to reopen the app, and the exception that Vladimir first posted shows up. I was able to reproduce the problem using a bare-bones test app. However, I found that when the problem occurred, reopening the test app would cause the black screen to show for a moment (or maybe not at all), and the app would restart itself. Adding to tiapp.xml prevented the test app from restarting itself, and the black screen would persist. But, in my production app, setting alwaysRetainTaskState to false does not cause the app to automatically restart after the problem happens. It will still go to the black screen. While the problem can happen if the phone is idle for several hours, it can typically be reproduced by high CPU usage. Opening other applications, closing other applications, etc. Sometimes just opening a web browser and hitting the home button is enough to cause it to happen, other times I need to keep at it for several minutes, opening, using, and closing other apps. If two Titanium applications are open at the same time, and the problem occurs, they will both get wiped out at the same time. I saw it happen once on an HTC One, but haven't been able to reproduce it on that device again, so it could have just been a fluke. It's very easy to reproduce on my Galaxy S2, and someone else's S4. So far the customer complaints we've seen have been using Galaxy devices. I tried reproducing the behavior using other non-titanium apps on my device, and was unable to. If there's anything else I can do or try in order for this ticket to get reopened, please let me know. Edit: I downloaded some random apps from the app showcase that have updated recently, and was able to reproduce this issue on other Titanium apps (Gamestop for example, though it managed to restart itself a couple seconds after the black screen appeared, similar to what my test app would do when alwaysRetainTaskState was set to false). Thanks
  12. Ritu Agrawal 2014-02-18

    Reopening this ticket based on latest comment.
  13. Adam Magana 2014-02-27

    I can confirm the claims made by Jack Wilson using my company's Android app. My company has been receiving numerous complaints from our Android customers experiencing the "black screen of death." I followed the same exact steps as Jack did to investigate his claims, as well as our customers' claims, (including the extra tests involving the Gamestop app) and received the exact same results. The only differences I've encountered involve the alwaysRetainTaskState parameter. When the parameter is not specified or explicitly set to true the app crashes as expected, however, there is no way to force the app to restart unless you force-quit the app via Android app settings. When the alwaysRetainTaskState parameter is set to false it crashes as expected but in this case it allows the user to press the back button twice upon which time it will restart the application. This is very very critical to us as the app appears to be entirely broken and useless to our users on a regular basis. In the meantime we are looking to revert to a Titanium version that does not produce this bug. Any further insight as to how to patch this in the meantime would be greatly appreciated.
  14. Ritu Agrawal 2014-03-03

    Moving this ticket to engineering for further evaluation. I have not been able to reproduce this issue but it has been reported as an intermittent issue and multiple people are running into this issue.
  15. Hieu Pham 2014-05-19

    3.2.x PR: https://github.com/appcelerator/titanium_mobile/pull/5703
  16. Jack Wilson 2014-05-20

    Pull 5703 has the same effect as the code that Vladamir posted months ago, that surrounded that entire method in a try/catch. The crash still happens just as easily, but the postAnalyticsEvent exception doesn't get thrown when you go back into the app after the crash. Also, it goes to a completely black screen, as opposed to a black screen with the app name in a bar up top (for me anyway). I believe the postAnalyticsEvent exception is a result of the crash, and has nothing to do with the cause.
  17. david fabreguette 2014-06-11

    Looks like I'm experiencing the same issue. I posted a ticket on appcelerator.com, on http://developer.appcelerator.com/question/156480/application-crashes-after-a-period-in-the-background-including-services. Is anyone of you can tell me when is it going to be fixed, and if there is a workaround ? I saw in previous comments that some of you used try / catch statements but can I use one with a service since I would have no idea where to place it as I have no idea where the code is wrong ! If anyone is available a few minutes on IRC to help me out on that it would be your good action of the day and I'll owe you a beer !
  18. Ingo Muschenetz 2014-06-12

    [~davidfabreguette] Can you please post the crash you are experiencing here?
  19. david fabreguette 2014-06-13

    Sure here it is : 06-11 14:24:34.014: E/TiApplication(21142): (main) [41115,41712] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to resume activity {com.idfuze.prestatech/org.appcelerator.titanium.TiTranslucentActivity}: java.lang.NullPointerException; Titanium 3.2.3,2014/04/22 10:17,b958a70 06-11 14:24:34.014: E/TiApplication(21142): java.lang.RuntimeException: Unable to resume activity {com.idfuze.prestatech/org.appcelerator.titanium.TiTranslucentActivity}: java.lang.NullPointerException 06-11 14:24:34.014: E/TiApplication(21142): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2826) 06-11 14:24:34.014: E/TiApplication(21142): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2859) 06-11 14:24:34.014: E/TiApplication(21142): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2274) 06-11 14:24:34.014: E/TiApplication(21142): at android.app.ActivityThread.access$800(ActivityThread.java:139) 06-11 14:24:34.014: E/TiApplication(21142): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210) 06-11 14:24:34.014: E/TiApplication(21142): at android.os.Handler.dispatchMessage(Handler.java:102) 06-11 14:24:34.014: E/TiApplication(21142): at android.os.Looper.loop(Looper.java:136) 06-11 14:24:34.014: E/TiApplication(21142): at android.app.ActivityThread.main(ActivityThread.java:5102) 06-11 14:24:34.014: E/TiApplication(21142): at java.lang.reflect.Method.invokeNative(Native Method) 06-11 14:24:34.014: E/TiApplication(21142): at java.lang.reflect.Method.invoke(Method.java:515) 06-11 14:24:34.014: E/TiApplication(21142): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 06-11 14:24:34.014: E/TiApplication(21142): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 06-11 14:24:34.014: E/TiApplication(21142): at dalvik.system.NativeStart.main(Native Method) 06-11 14:24:34.014: E/TiApplication(21142): Caused by: java.lang.NullPointerException 06-11 14:24:34.014: E/TiApplication(21142): at org.appcelerator.titanium.TiApplication.postAnalyticsEvent(TiApplication.java:690) 06-11 14:24:34.014: E/TiApplication(21142): at org.appcelerator.titanium.TiBaseActivity.onResume(TiBaseActivity.java:1045) 06-11 14:24:34.014: E/TiApplication(21142): at org.appcelerator.titanium.TiActivity.onResume(TiActivity.java:35) 06-11 14:24:34.014: E/TiApplication(21142): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1215) 06-11 14:24:34.014: E/TiApplication(21142): at android.app.Activity.performResume(Activity.java:5327) 06-11 14:24:34.014: E/TiApplication(21142): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2811) 06-11 14:24:34.014: E/TiApplication(21142): ... 12 more
  20. Ingo Muschenetz 2014-06-19

    All, we believe this may have been solved in SDK 3.3.0 (or that the exception above noting the error of org.appcelerator.titanium.TiApplication.postAnalyticsEvent() is a red herring and will now be replaced with the true error). Can you all please try this with SDK 3.3.0 and let us know if the issue is resolved or if you get a different error.
  21. Jack Wilson 2014-06-20

    There doesn't appear to be any difference between SDK 3.3.0 RC and Pull 5703. When opening the app into the black screen there's the message APSAnalytics has not been initialized. Call APSAnalytics.enable(ctx, key) to initialize. but otherwise no mention of Analytics that I can see. No exceptions are being thrown, it just goes into the black screen as usual after disappearing from the task manager.
  22. Ingo Muschenetz 2014-06-23

    All, please try build #77 of 3.3.X (from http://builds.appcelerator.com/#3_3_X) to see if this addresses the issue. This includes a fix for thread-safety in analytics.
  23. Jack Wilson 2014-06-23

    It's still crashing the same, but now instead of going to the black screen it gets stuck on the splash screen with the following exception.
        06-23 15:08:12.410: E/TiApplication(13621): (main) [1238,3143] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to resume activity {com.cao.chat/org.appcelerator.titanium.TiActivity}: java.lang.IllegalStateException: APSAnalytics has not been enabled. Call APSAnalytics.getInstance().enable(ctx, key, deploytype) to enable.; Titanium 3.3.0,2014/06/20 19:49,e884d34
        06-23 15:08:12.410: E/TiApplication(13621): java.lang.RuntimeException: Unable to resume activity {com.cao.chat/org.appcelerator.titanium.TiActivity}: java.lang.IllegalStateException: APSAnalytics has not been enabled. Call APSAnalytics.getInstance().enable(ctx, key, deploytype) to enable.
        06-23 15:08:12.410: E/TiApplication(13621): 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2642)
        06-23 15:08:12.410: E/TiApplication(13621): 	at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2670)
        06-23 15:08:12.410: E/TiApplication(13621): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2140)
        06-23 15:08:12.410: E/TiApplication(13621): 	at android.app.ActivityThread.access$700(ActivityThread.java:140)
        06-23 15:08:12.410: E/TiApplication(13621): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
        06-23 15:08:12.410: E/TiApplication(13621): 	at android.os.Handler.dispatchMessage(Handler.java:99)
        06-23 15:08:12.410: E/TiApplication(13621): 	at android.os.Looper.loop(Looper.java:137)
        06-23 15:08:12.410: E/TiApplication(13621): 	at android.app.ActivityThread.main(ActivityThread.java:4938)
        06-23 15:08:12.410: E/TiApplication(13621): 	at java.lang.reflect.Method.invokeNative(Native Method)
        06-23 15:08:12.410: E/TiApplication(13621): 	at java.lang.reflect.Method.invoke(Method.java:511)
        06-23 15:08:12.410: E/TiApplication(13621): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
        06-23 15:08:12.410: E/TiApplication(13621): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
        06-23 15:08:12.410: E/TiApplication(13621): 	at dalvik.system.NativeStart.main(Native Method)
        06-23 15:08:12.410: E/TiApplication(13621): Caused by: java.lang.IllegalStateException: APSAnalytics has not been enabled. Call APSAnalytics.getInstance().enable(ctx, key, deploytype) to enable.
        06-23 15:08:12.410: E/TiApplication(13621): 	at com.appcelerator.analytics.APSAnalytics.throwUnlessEnabled(APSAnalytics.java:278)
        06-23 15:08:12.410: E/TiApplication(13621): 	at com.appcelerator.analytics.APSAnalytics.sendAppForegroundEvent(APSAnalytics.java:158)
        06-23 15:08:12.410: E/TiApplication(13621): 	at org.appcelerator.titanium.TiBaseActivity.onResume(TiBaseActivity.java:1035)
        06-23 15:08:12.410: E/TiApplication(13621): 	at org.appcelerator.titanium.TiActivity.onResume(TiActivity.java:35)
        06-23 15:08:12.410: E/TiApplication(13621): 	at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1199)
        06-23 15:08:12.410: E/TiApplication(13621): 	at android.app.Activity.performResume(Activity.java:5262)
        06-23 15:08:12.410: E/TiApplication(13621): 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2632)
        06-23 15:08:12.410: E/TiApplication(13621): 	... 12 more
        
  24. Ingo Muschenetz 2014-06-23

    All, is it possible to get a copy of the application? We can handle it in confidence and delete it when done.
  25. Ping Wang 2014-07-11

    PR: https://github.com/appcelerator/titanium_mobile/pull/5908 For FR, please also test TIMOB-15971.
  26. Jack Wilson 2014-07-16

    My app did restart after vanishing from the task manager, as opposed to going to the black screen. Thank you to everyone who worked on getting this resolved.
  27. Alex Bernier 2014-07-16

    Thank you, everyone, and thank you Jack for providing them information!
  28. david fabreguette 2014-07-17

    Thank you everyone for that ! How can I test this out ?
  29. Jack Wilson 2014-07-17

    David, Install the latest build from here: [http://builds.appcelerator.com/#master] Copy the url to the zip file for the OS you need, then in Titanium Studio under Help -> Install Titanium SDK choose install from URL and paste the copied URL. After it's installed, change the sdk in your tiapp.xml file.
  30. david fabreguette 2014-07-17

    Thanks ! I'm giving it a try :)
  31. Jack Wilson 2014-07-17

    One problem that I am seeing with this solution: if the app has died in the background, and a push notification comes in, when the app restarts it doesn't fire the callback, so the payload of the push is effectively lost. I tested this with Urban Airship.
  32. Ping Wang 2014-07-18

    [~jwincao], that behavior is expected. By default, all components of the same application, including activities, services, receivers and providers, run in the same process. When the app is killed in the background due to low memory, what actually happens is that the whole process is killed. In that case, the BroadcastReceiver is unable to listen to the notifications until the app is relaunched.
  33. Jack Wilson 2014-07-18

    Thanks for your response, Ping. To clarify, I do still get a push notification even though the app has died in the background, and clicking on the notification it opens up the app as expected. I think the problem is that when the app reopens in this somewhat dead state, and the app is forceably restarted as a result, instead of it having been opened with the push notification which contains a payload, it's being opened through another means, and so the push is now lost. So in other words, the app is being opened twice. Once from the push notification, and then a second time as a result of being immediately restarted as per the fix you implemented. When it opens the second time, it no longer has the push payload. That may be the exact situation you're describing, but I just wanted to clarify. Thanks for your help.
  34. david fabreguette 2014-08-05

    I ran into the error below today (same as you Jack Wilson) even though I upgraded to Titanium latest pull on master (SDK 3.4.0v20140716113312). I had it on my emulator GenyMotion CustomPhone 7, Android 4.1.1 API 16. Any idea of what's happening ? [ERROR] : TiApplication: (KrollRuntimeThread) [71,280] Sending event: exception on thread: KrollRuntimeThread msg:java.lang.IllegalStateException: APSAnalytics has not been enabled. Call APSAnalytics.getInstance().enable(ctx, key, deploytype) to enable.; Titanium 3.4.0,2014/07/16 11:33,9d1b1f0 [ERROR] : TiApplication: java.lang.IllegalStateException: APSAnalytics has not been enabled. Call APSAnalytics.getInstance().enable(ctx, key, deploytype) to enable. [ERROR] : TiApplication: at com.appcelerator.analytics.APSAnalytics.throwUnlessEnabled(APSAnalytics.java:251) [ERROR] : TiApplication: at com.appcelerator.analytics.APSAnalytics.sendAppGeoEvent(APSAnalytics.java:155) [ERROR] : TiApplication: at ti.modules.titanium.geolocation.TiLocation.doAnalytics(TiLocation.java:155) [ERROR] : TiApplication: at ti.modules.titanium.geolocation.GeolocationModule.doAnalytics(GeolocationModule.java:230) [ERROR] : TiApplication: at ti.modules.titanium.geolocation.GeolocationModule.onLocationChanged(GeolocationModule.java:248) [ERROR] : TiApplication: at ti.modules.titanium.geolocation.android.LocationProviderProxy.onLocationChanged(LocationProviderProxy.java:112) [ERROR] : TiApplication: at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:234) [ERROR] : TiApplication: at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java:167) [ERROR] : TiApplication: at android.location.LocationManager$ListenerTransport$1.handleMessage(LocationManager.java:183) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:99) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:137) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)
  35. david fabreguette 2014-08-05

    Just had it as well on real device : Moto G / Android 4.4.4 :(
  36. david fabreguette 2014-08-18

    Anyone still having this issue ?
  37. Lokesh Choudhary 2014-09-17

    Verified the fix with the analytics app feature test app for QE & did not see any crash. Will be verifying with the customers app & update with the results. Environment: Appc Studio : 3.4.0.201409161950 Ti SDK : 3.4.0.v20140916181713 Mac OSX : 10.9.4 Alloy : 1.5.0-rc2 CLI - 3.4.0-rc4 Code Processor: 1.1.1 Nexus 5 - android 4.4.4
  38. Ingo Muschenetz 2015-02-03

    [~sliang] Please provide a new test case to reproduce the issue.
  39. Shuo Liang 2015-02-04

    [~ingo], Main problem happened here.
        (function(activity, gcm) {
          var intent = activity.intent;
        
          // HERE we catch the intent extras of our notifications
          if (intent.hasExtra('ntfId')) {
            // and then we'll use 'data' property to pass info to the app (see pendingData lines of the 1st snippet)
            gcm.data = {
              ntfId: intent.getIntExtra('ntfId', 0),
              collapse_key: intent.getStringExtra('collapse_key', ''),
              message: intent.getStringExtra('message', ''),
              title: intent.getStringExtra('title', '')
            };
          }
          
          Ti.App.Properties.removeProperty('unread_saved_search_notifications_count');
          
          // 'isLauncherActivity' is a module property which tell us if the app is not running
         // if (gcm.isLauncherActivity) {
          	alert("App was NOT running");
            // Ti.API.info("intent://#Intent;package="+Ti.App.id+";scheme=" + Ti.App.id + ";launchFlags=268435456;end;");
            // Ti.Platform.openURL("intent://#Intent;package="+Ti.App.id+";scheme=" + Ti.App.id + ";launchFlags=268435456;end;");
            // return;
            
            // if the app is not running, we need to start our app launcher activity
            // (launcher activity shows the splash screen and setup your app environment, so we need this)
            var mainActivityIntent = Ti.Android.createIntent({
              // flags: Ti.Android.FLAG_ACTIVITY_NEW_TASK,
              category: Ti.Android.CATEGORY_LAUNCHER,      
              // 'mainActivityClassName' is another module property with name of our app launcher activity
              className: gcm.mainActivityClassName,
              packageName: Ti.App.id,
              flags : Ti.Android.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Ti.Android.FLAG_ACTIVITY_SINGLE_TOP
            }); 
            // mainActivityIntent.addCategory(Ti.Android.CATEGORY_LAUNCHER);
            activity.startActivity(mainActivityIntent);
            // Ti.include('app.js');
          //} else {
            // if the app is running (is being resumed), just finish this activity!
            //alert("App was running");
            //activity.finish();
            
          //}
        
        })(Ti.Android.currentActivity, require('net.iamyellow.gcmjs'));
        
  40. Ping Wang 2015-02-12

    [~sliang], you mentioned the crash happened when the android app was killed. Did you mean swiping app away from the recent apps list? If yes, you can take a look at TIMOB-15180 and TIMOB-14674 to get some idea what happens when you swipe app away. In the code you attached above, can you tell me when the app crashed, what value gcm.isLauncherActivity returns, true or false?
  41. Shuo Liang 2015-02-12

    [~pwang], We had customer close the case for now since iamyellow module is not our product. thank you for your feedback. Will contact you if still need something more.
  42. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source