Titanium JIRA Archive
Appcelerator Community (AC)

[AC-412] App sometimes crash when launched from notification area

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2015-11-11T22:51:30.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterAndreas Hyden
AssigneeShak Hossain
Created2015-07-15T03:51:59.000+0000
Updated2016-01-06T19:29:41.000+0000

Description

App sometimes crash during startup when launched from the Android notification area. How to reproduce - Make sure app is not running - Receive push notifications for app - Click on push notification in the Android notification area to launch the app. - (If another notification is received at the moment the app is launching, it seems to greatly increase the chance of a crash.) - App sometimes crashes Crash log: E/AndroidRuntime(10783): FATAL EXCEPTION: main E/AndroidRuntime(10783): Process: hk.com.beamstyle.snakehead, PID: 10783 E/AndroidRuntime(10783): java.lang.RuntimeException: Unable to start receiver com.appcelerator.aps.IntentReceiver: java.lang.RuntimeException: Application context not provided E/AndroidRuntime(10783): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2856) E/AndroidRuntime(10783): at android.app.ActivityThread.access$1700(ActivityThread.java:156) E/AndroidRuntime(10783): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1440) E/AndroidRuntime(10783): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(10783): at android.os.Looper.loop(Looper.java:157) E/AndroidRuntime(10783): at android.app.ActivityThread.main(ActivityThread.java:5872) E/AndroidRuntime(10783): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(10783): at java.lang.reflect.Method.invoke(Method.java:515) E/AndroidRuntime(10783): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) E/AndroidRuntime(10783): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:674) E/AndroidRuntime(10783): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime(10783): Caused by: java.lang.RuntimeException: Application context not provided E/AndroidRuntime(10783): at com.appcelerator.aps.Settings.props(Settings.java:58) E/AndroidRuntime(10783): at com.appcelerator.aps.Settings.useSingleCallback(Settings.java:83) E/AndroidRuntime(10783): at com.appcelerator.aps.APSCloudPush.processCallbackIfInstantiated(APSCloudPush.java:651) E/AndroidRuntime(10783): at com.appcelerator.aps.IntentReceiver.onReceive(IntentReceiver.java:72) E/AndroidRuntime(10783): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2845) E/AndroidRuntime(10783): ... 10 more E/ActivityManager( 719): App crashed! Process: hk.com.beamstyle.snakehead

Comments

  1. David Fischer 2015-08-27

    I'm seeing the same java.lang.RuntimeException: Unable to start receiver com.appcelerator.aps.IntentReceiver: java.lang.RuntimeException: Application context not provided error. I do not have a CloudPush "callback" eventListener so it is not a bug in the event listener. I'm merely relying on the user clicking the push notification to launch the app. It is very intermittent but I'm seeing 5-10 reports a day in the Play store. However, there is a key difference between launching the app with a push notification click vs. clicking on the app icon in the launcher and that is that the former does not use "android:clearTaskOnLaunch" (from the manifest) which will essentially restart the app when it is launched. As a result, the app attempts to resume when launched. I have had a lot of problems with resuming Android apps on Titanium and that's why I use "android:clearTaskOnLaunch". I'm guessing this is a problem with a failed resume. I'll try to verify.
  2. Thomas Cheng 2015-09-25

    Hello there, I wonder if there are any updates on this? Basically I'm almost guaranteed to receive a crash when my app is running in the background for a long time, and then I receive a push notification, I click on the push notification and resume the app. Like what Andreas said, the chance of crash increases significantly when I do the following: - Let my app run in background (Press Android Home key) - Then I receive some other push notification from a completely different unrelated app (eg. Whatsapp, let's say I receive a message or something) - Then I receive a push notification from my app - Then I click on the push notification icon for my app. Thanks guys! Cheers, Thomas
  3. Harish Mridha 2015-09-25

    Hello, I tested the issue you reported. But we did not reproduce this issue as a bug. App did not crash when we launch the app from the notification area. I tested this using the TiSDK 5.0.0 GA ,Appcelerator Studio, build: 4.3.0.201509151348 and Nexus7 (Android 5.1.1) I recommend you upgrade TiSDK to the latest build and let us know if you get the error again. Thanks
  4. David Fischer 2016-01-06

JSON Source