Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26625] Android: Can't open Titanium app through intent (7.5.0 regression)

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-12-06T00:24:22.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.5.1
ComponentsAndroid
LabelsAndroid, Intent, SafeArea
ReporterJorge Macias Garcia
AssigneeYordan Banev
Created2018-12-04T08:33:05.000+0000
Updated2019-01-08T03:17:48.000+0000

Description

After 7.5.0.GA release it is not possible to launch a Titanium app through an intent. It hangs on the startup. It seems related with new safeArea feature implemented on 7.5.0 SDK. Why is happening this? I don't know but it should not influence in the communication between apps. I've attached a sample app and the logcat error trace. Steps to reproduce: 1. Compile both apps and deploy it. 2. Launch SourceApp 3. Click "Open Target" 4. TargetApp hangs at startup due to Ti exception

Attachments

FileDateSize
app-test-classic.zip2018-12-04T08:29:41.000+00006266740
log.txt2018-12-04T08:29:45.000+00005223

Comments

  1. Hans Knöchel 2018-12-04

    Same here. We really hope to see a quick 7.5.1 with this one and a backport of https://github.com/appcelerator/titanium_mobile/pull/10479. Otherwise people are quite unable to use this SDK in production.
  2. Yordan Banev 2018-12-04

    PR: https://github.com/appcelerator/titanium_mobile/pull/10507
  3. Jorge Macias Garcia 2018-12-04

    8.0.0? Really?
  4. Gary Mathews 2018-12-04

    7_5_X: https://github.com/appcelerator/titanium_mobile/pull/10508
  5. Lokesh Choudhary 2018-12-04

    Encountered some issues on android 4.1.Commented in the PR.
  6. Lokesh Choudhary 2018-12-06

    FR Passed. PR's merged.
  7. Lokesh Choudhary 2018-12-10

    Verified the fix in SDK 7.5.1.v20181210141225 & 8.0.0.v20181210140414. Closing.
  8. Gertjan Smits 2019-01-06

    I'm pretty sure it isn't fixed. Or I encountered another issue. I have a reproducible test project which I can upload (but I can't because the ticket is closed I think). I want to be able to open my app by registering a url to it. My main activity looks like this: {noformat} {noformat} This worked perfectly fine in *7.4.1.GA*. app.js is executed again when the app is opened from the url, in this case api-dev.ocomondo.com. This is also where I've setup the assetlinks.json file. It's broken in *7.5.0.GA* and also in *7.5.1.v20181218070137*.
  9. Joshua Quick 2019-01-08

    [~gertjans], this ticket fixes a very specific issue where launching the app with a data intent will cause a "crash" in Titanium 7.5.0. It was a regression that was solved in Titanium 7.5.1. What exactly is not working for you? When you launch your app via a URL intent, does your app look like it gets stuck at the splash screen? If so, then that's not a new issue. That's been an issue for a long while. It happens when you already have an app window instance in the background and you try to launch a new instance via a different intent. Unfortunately, Titanium doesn't support multiple activity instances through different intents. Titanium has never supported this. The issue is that a JavaScript runtime is already running in the background and all JavaScript files that have already been required-in by the 1st instance can't be executed a 2nd time because they're already cached. The behavior that has changed in 7.5.0 is that Titanium will no longer execute the "app.js" a second time if it's already currently running in the background. That was a caching issue only with "app.js". But even in 7.4.0 when it executed "app.js" a 2nd time, any JS files you have required in before wouldn't have been executed a 2nd time anyways. The require() functions would have returned the cached JS modules instead. So, with the current and older versions of Titanium, what you're supposed to do is one of the following:

    Use Android launchMode "singleTask". But note that this will automatically close all child activity windows upon resume (this is Google's behavior, not Titanium's).

    Use "tiapp.xml" property "intent-filter-new-task" as documented [here](https://docs.appcelerator.com/platform/latest/#!/guide/tiapp.xml_and_timodule.xml_Reference-section-src-29004921_tiapp.xmlandtimodule.xmlReference-intent-filter-new-task).

    Or wait for Titanium 8.0.0 where we've completely refactored the intent handling code. In that version, Titanium will replicate "singleTask" like behavior but without the child activities from being destroyed. If an Android app window is already in the background, then it will be resumed, and a "newIntent" event will be fired. It will effectively work just like iOS does which is the behavior everyone is after. Please see [TIMOB-26075] for more details.

JSON Source