If you add the UrbanAirship module for Android to the Kitchen Sink app,
the app opens on a blank/black window after being backgrounded (and the app memory has been released).
Without this module, Kitchen Sink works properly.
Set up Kitchen Sink for the issue
1. Download the Kitchen Sink source code
2. Include the latest Urban Airship module (
https://github.com/appcelerator/titanium_modules/tree/master/urbanairship/mobile/android) to Kitchen Sink.
- Add the module in the source code.
- Add the module just below the other modules in the tiapp.xml:
ti.urbanairship
Steps to reproduce the bug:
1. Open Kitchen Sink
2. Click on the home button, to let the app live in background
3. Open at least 15 other apps, and let the live by clicking on the home button.
(The aim, here, is to destroy the Kitchen Sink alive activities in order to force the app to "restart"). Actually you have to open apps until the Kitchen Sink activities desappear when you launch the command: adb shell dumpsys activity
4. Resume the Kitchen Sink app
Observed behavior: app freeze on a black screen
Expected behavior: "clean" restart
Noticed this issue also, it happens when app is put in the background for some time. Black screen can be seen and after back button is pressed to close that black screen, splash screen is shown and app is restarted.
I'm seeing this on 3.2 SDK without the Urban Airship module, when installed from Studio (not seeing when installed from TestFlight). Here are the modules I'm using, though my list hasn't changed from 3.1.3.GA to 3.2.GA, so it seems 3.2.GA SDK is the cause, not a specific module: ti.cloud ti.cloudpush analytics.google ti.imagefactory facebook Only seeing this in dev, though, so we're not production impacted.
I can confirm that my company is having the same issue with our Android app. We are also using the Urban Airship module so I cannot confirm whether or not Alejandro's issue is something else entirely. Currently this bug is occurring in our production release of our app so this is extremely high priority for us. We will be rolling back our Titanium version until a fix can be made.
[~adammagana] A few questions:
What version of SDK are you using that works?
Which version fails?
What are the modules you are using in your project?
Can you please file the crash log?
Since I left the first comment we've had a development. We reverted our Titanium SDK version to
3.1.3.GA
and our CLI version to3.1.2
but we are still having crashes. We have tried deploying using deploy typetest
and deploy typeproduction
. The only module we are using is the Urban Airship (https://github.com/appcelerator/titanium_modules/blob/master/urbanairship/mobile/android/documentation/index.md) module. Here is our crash log:That appears to be caused by this line: https://github.com/appcelerator/titanium_mobile/blob/3_1_X/android/titanium/src/java/org/appcelerator/titanium/TiApplication.java#L662 or this in master: https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/TiApplication.java#L690 It seems that https://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/TiApplication.java#L495 (collectAnalytics) appears to have returned false.
[~hpham] to double-check if still crashing with 3.3.0.
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.
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.
I tried the 3.3.0.Beta SDK and I am sorry to tell you that the bug still happens.
[~arnaud] Can you please tell me the exact version you tried? Was it build #77 or later? If you are still getting the crash, what is the crash you are now getting?
I don't know which version it is. I think I downloaded it from this page: https://www.appcelerator.com/blog/2014/06/announcing-the-3-3-0-release-candidate-of-titanium-sdk-and-studio/ The SDK name is 3.3.0.Beta (now the page link enables to download the 3.3.0.RC) but I don't which version. Can you tell me if I can find this info in the SDK package? The bug may not be exactly the same (I tried this new SDK in development environment - vs the issue found in production -) The application opens a "white screen" (empty activity), like it does with old SDKs. And then, the app crashes (I did not experience that with the production app).
[~arnaud_besnier] What is the crash log?
I tried to reproduce the bug with the latest 3.3.0.RC and also 3.3.0.v20140710142512-osx. The bug is still present. Here is the crash log: 7-11 14:31:40.180: D/TiProperties(6221): (KrollRuntimeThread) [38,2934] setBool called with key:UrbanAirship.showAppOnClick, value:true 07-11 14:31:40.535: I/TiAPI(6221): | 2014-07-11 14:31:40:519 | ===> UrbanAirship Registration 07-11 14:31:41.890: I/Dev 1.0.0 - UALib(6221): Sending Analytics to: https://combine.urbanairship.com/warp9/ 07-11 14:32:20.940: D/dalvikvm(7562): Trying to load lib /data/app-lib/com.shopmium-1/libti.urbanairship.so 0x425b3398 07-11 14:32:20.945: D/dalvikvm(7562): Added shared lib /data/app-lib/com.shopmium-1/libti.urbanairship.so 0x425b3398 07-11 14:32:20.945: D/dalvikvm(7562): No JNI_OnLoad found in /data/app-lib/com.shopmium-1/libti.urbanairship.so 0x425b3398, skipping init 07-11 14:32:49.900: D/KrollV8Runtime(8723): (KrollRuntimeThread) [5,1994] Bootstrapping module: ti.urbanairship 07-11 14:32:49.905: D/dalvikvm(8723): Trying to load lib /data/app-lib/com.shopmium.dev-1/libti.urbanairship.so 0x425b5fd8 07-11 14:32:49.910: D/dalvikvm(8723): Added shared lib /data/app-lib/com.shopmium.dev-1/libti.urbanairship.so 0x425b5fd8 07-11 14:32:49.910: D/dalvikvm(8723): No JNI_OnLoad found in /data/app-lib/com.shopmium.dev-1/libti.urbanairship.so 0x425b5fd8, skipping init 07-11 14:32:52.205: I/Dev 1.0.0 - UALib(8723): Sending Analytics to: https://combine.urbanairship.com/warp9/ 07-11 14:32:53.615: W/ActivityManager(2347): Unable to start service Intent { act=android.intent.action.PACKAGE_REPLACED dat=package:com.shopmium.dev flg=0x8000014 cmp=com.shopmium.dev/com.urbanairship.push.GCMPushReceiver (has extras) } U=0: not found 07-11 14:32:57.120: D/dalvikvm(9057): Trying to load lib /data/app-lib/com.shopmium-1/libti.urbanairship.so 0x425b0d38 07-11 14:32:57.130: D/dalvikvm(9057): Added shared lib /data/app-lib/com.shopmium-1/libti.urbanairship.so 0x425b0d38 07-11 14:32:57.130: D/dalvikvm(9057): No JNI_OnLoad found in /data/app-lib/com.shopmium-1/libti.urbanairship.so 0x425b0d38, skipping init We tried to update the UrbanAirship module with the latest UrbanAirship library (4.0.2), it does not fix the bug. Are you really sure the SDK can fix something?
With a minimal Titanium app, the bug is present. I tried to create a minimal Android native app with the Urban Airship integration (library version 4.0.2), I did not manage to reproduce the bug. I have no doubts now, that Titanium integration is the origin of the issue. Do you have any inputs? Could we patch the SDK (even a ugly patch) ?
Ok, I just tried your patch. It works! the app restarts properly. Reading the code, I don't feel like this patch could bring severe regression. Can we be confident with it? What do you think? Thank you for your help
This is a duplicate of TIMOB-16538.
Closing ticket with reference to previous comments.