Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28376] Android: Update header and footer view activity

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2021-03-11T14:49:10.000+0000
Affected Version/sRelease 9.3.2, Release 10.1.0, Release 10.0.0
Fix Version/sRelease 10.0.0
ComponentsAndroid
Labelsandroid, crash, fragments, mapview
ReporterHans Knöchel
AssigneeGary Mathews
Created2021-03-07T13:05:21.000+0000
Updated2021-03-11T14:49:10.000+0000

Description

The following code crashes the app on Android, while it works fine on iOS:
const window = Ti.UI.createWindow();
const mapView = Ti.UI.createView({ height: 200 });
mapView.add(require('ti.map').createView());

const listView = Ti.UI.createListView({
	headerView: mapView, // This throws the error - works fine on iOS
	sections: [
		Ti.UI.createListSection({
			items: [ { title: 'Test 1' }, { title: 'Test 2' }, { title: 'Test 3' } ]
		})
	]
})

window.add(listView);
window.open();
The crash / stacktrace is:
[ERROR] E/com.example.app Invalid ID 0x00000002.
[DEBUG] AndroidRuntime: Shutting down VM
[ERROR] TiExceptionHandler: (main) [1539,1753] No view found for id 0x2 (unknown) for fragment SupportMapFragment{b743c3e} (b6132652-63cc-4547-83f3-18d882add40a) id=0x2}
[ERROR] TiExceptionHandler:
[ERROR] TiExceptionHandler:     androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:315)
[ERROR] TiExceptionHandler:     androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1199)
[ERROR] TiExceptionHandler:     androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1368)
[ERROR] TiExceptionHandler:     androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1446)
[ERROR] TiExceptionHandler:     androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1509)
[ERROR] TiExceptionHandler:     androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:447)
[ERROR] TiExceptionHandler:     androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2181)
[ERROR] TiExceptionHandler:     androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2004)
[ERROR] TiExceptionHandler:     androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1959)
[ERROR] TiExceptionHandler:     androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1861)
[ERROR] TiExceptionHandler:     androidx.fragment.app.FragmentManager$4.run(FragmentManager.java:413)
[ERROR] TiExceptionHandler:     android.os.Handler.handleCallback(Handler.java:938)
[ERROR] TiExceptionHandler:     android.os.Handler.dispatchMessage(Handler.java:99)
[ERROR] TiExceptionHandler:     android.os.Looper.loop(Looper.java:223)
[ERROR] TiExceptionHandler:     android.app.ActivityThread.main(ActivityThread.java:7656)
[ERROR] TiExceptionHandler:     java.lang.reflect.Method.invoke(Native Method)
[ERROR] TiExceptionHandler:     com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
[ERROR] TiExceptionHandler:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
It's a blocker we currently cannot workaround, so it'd be great to have some feedback on it - maybe then we can fix it ourselves. Thank you!

Attachments

FileDateSize
ListViewHeaderViewTest.js2021-03-09T23:47:32.000+0000768
TableViewHeaderLabelTest.js2021-03-09T23:46:48.000+0000845

Comments

  1. Hans Knöchel 2021-03-07

    PR (by Sergey): https://github.com/appcelerator/titanium_mobile/pull/12524
  2. Joshua Quick 2021-03-09

    This bug also prevented the headerView/footerView from updating after a dark/light theme change. So, we'll need this fixed for 10.0.0 since that SDK version adds official dark/light theme support. Thanks for bringing this up [~hknoechel]!
  3. Samir Mohammed 2021-03-10

    FR Passed, waiting on Jenkins build and backports.
  4. Christopher Williams 2021-03-11

    Squash merged to master, manually cherry-picked to 10_0_X for 10.0.0 target

JSON Source