Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28385] Android ListView crash error on SDK 9.3.X

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2021-05-18T18:15:37.000+0000
Affected Version/sRelease 9.3.0
Fix Version/sRelease 10.0.0, Release 9.3.3
ComponentsAndroid
LabelsListView, android, regression
ReporterCristina Avila
AssigneeGary Mathews
Created2021-02-13T19:24:44.000+0000
Updated2021-05-18T18:15:42.000+0000

Description

*Platform* Android only *SDK* 9.3.0.GA, 9.3.1.GA and 9.3.2.GA ListView is crashing while scrolling. This is reproducible if the ListItem has an ImageView that should load an image from url. If I roll back to 9.2.2.GA the ListView is working as expected. *Crash error* [{{ERROR] TiExceptionHandler: (main) [30297,30666] Attempt to invoke virtual method 'android.app.Activity org.appcelerator.kroll.KrollProxy.getActivity()' on a null object reference [ERROR] TiExceptionHandler: [ERROR] TiExceptionHandler: org.appcelerator.titanium.view.TiDrawableReference.fromUrl(TiDrawableReference.java:163) [ERROR] TiExceptionHandler: ti.modules.titanium.ui.widget.TiUIImageView$1.downloadTaskFinished(TiUIImageView.java:105) [ERROR] TiExceptionHandler: org.appcelerator.titanium.util.TiDownloadManager.handleFireDownloadMessage(TiDownloadManager.java:284) [ERROR] TiExceptionHandler: org.appcelerator.titanium.util.TiDownloadManager.handleMessage(TiDownloadManager.java:355) [ERROR] TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:103) [ERROR] TiExceptionHandler: android.os.Looper.loop(Looper.java:214) [ERROR] TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:7356) [ERROR] TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method) [ERROR] TiExceptionHandler: com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) [ERROR] TiExceptionHandler: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)}} *Example Code* Example code in attachments
<Alloy>
	<Window class="container" onOpen="setupList">
		<ListView id="listView" defaultItemTemplate="template">
			<Templates>
				<ItemTemplate name="customtemplate">
					<View class="card">
						<ImageView bindId="image" class="pic" defaultImage="/images/defaultimg.png" />
						<Label bindId="title" class="title" />
					</View>
				</ItemTemplate>
			</Templates>
			<ListSection id="section" />
		</ListView>
	</Window>
</Alloy>
function setupList() {
	var items = []

	for (var x = 0; x < 50; x++) {
		items.push({
			template: 'customtemplate',
			image: {
				image: 'https://picsum.photos/200'
			},
			title: {
				text: 'Item no.' + x
			}
		});
	}

	$.section.items = items;
}

$.index.open();

Attachments

FileDateSize
source-app.zip2021-02-13T19:22:47.000+000094040

Comments

  1. Hans Knöchel 2021-03-07

    Can someone from the team please validate this? Thx!
  2. Cristina Avila 2021-03-11

    Just created a PR for this https://github.com/appcelerator/titanium_mobile/pull/12541
  3. Samir Mohammed 2021-03-12

    FR Passed, waiting on Jenkins build
  4. Christopher Williams 2021-03-12

    merged to 9_3_X, master and 10_0_X for 10.0.0 target

JSON Source