Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28501] Android: MapView within TabGroup crashes as of 10.0.1

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2021-07-19T14:04:09.000+0000
Affected Version/sRelease 10.0.1
Fix Version/sRelease 10.0.1
ComponentsAndroid
LabelsTabGroup, android, map, regression
ReporterJoshua Quick
AssigneeJoshua Quick
Created2021-07-02T01:02:37.000+0000
Updated2021-07-19T14:04:22.000+0000

Description

*Summary:* Displaying the "ti.map" module's MapView within a TabGroup crashes as of Titanium 10.0.1. This bug was caught before release. *Steps to reproduce:*

Build and run the below on Android.

Notice the app crashes on app startup.

const map = require("ti.map");
const tabWindow1 = Ti.UI.createWindow();
tabWindow1.add(map.createView({
	width: Ti.UI.FILL,
	height: Ti.UI.FILL,
}));
const tabWindow2 = Ti.UI.createWindow();
tabWindow2.add(Ti.UI.createLabel({ text: "Tab 2" }));
const tabWindow3 = Ti.UI.createWindow();
tabWindow3.add(Ti.UI.createLabel({ text: "Tab 3" }));
const tabGroup = Ti.UI.createTabGroup({
	tabs: [
		Ti.UI.createTab({ title: "Tab 1", window: tabWindow1 }),
		Ti.UI.createTab({ title: "Tab 2", window: tabWindow2 }),
		Ti.UI.createTab({ title: "Tab 3", window: tabWindow3 }),
	],
});
tabGroup.open();
*Cause:* This issue was caused by the Java TiViewProxy.handleGetView() method change made by the PR below. The issue is the native tab's parent activity was never set to the actual TabGroup activity. https://github.com/appcelerator/titanium_mobile/pull/12909/files#diff-c1ca52b23726a03177273b78aed424203d8f5352bf7ba2022f74e2f8ad536ce3

Comments

  1. Joshua Quick 2021-07-02

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/12932
  2. Ewan Harris 2021-07-19

    master and 10_0_X backport merged

JSON Source