Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25081] Android: Uncaught TypeError: Cannot use 'in' operator to search for 'Resources/alloy' in null.

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2018-01-10T22:33:27.000+0000
Affected Version/sRelease 6.1.2
Fix Version/sRelease 6.3.0
ComponentsAndroid
Labelsn/a
ReporterJebun Naher
AssigneeGary Mathews
Created2017-08-10T10:35:06.000+0000
Updated2018-08-06T17:49:15.000+0000

Description

*Issue Description:* With an app that has Webview on Android. When I close the app (window.close() or Titanium.Android.currentActivity.finish()). I open and close the app the same way again. The next time I click to open the app I get a Runtime error. Location:ti:/module.js Message: Uncaught TypeError: Cannot use 'in' operator to search for 'Resources/alloy' in null Source:return filename in fileIndex; *Steps to reproduce*: 1. Create an alloy app and replace with the test code below. 2. When you run it, then press back button on device to close the window. Wait a few seconds. Open again, then repeat. Then it should show the error. *Test Code:* Index.xml
<Alloy>
	<Window class="container">
		<WebView id='webview'></WebView>
	</Window>
</Alloy>
index.js
var webview = Titanium.UI.createWebView({url:'http://www.appcelerator.com'});
$.index.add(webview);
function doClick(e) {
	alert($.label.text);
}
//$.webview.url = 'http://www.appcelerator.com'; 
$.index.open();
$.index.addEventListener('android:back', function(){
    // close your current window
	webview.release();
	$.index.remove(webview);
	
	webview = null;
	var activity = Titanium.Android.currentActivity;
	activity.finish();
});
index.tss
".container": {
	backgroundColor:"white"
}

"Label": {
	width: Ti.UI.SIZE,
	height: Ti.UI.SIZE,
	color: "#000"
}

"#label": {
	font: {
		fontSize: 12
	}
}

Comments

  1. Gary Mathews 2017-10-02

    This should be fixed by TIMOB-25242
  2. Gary Mathews 2018-01-10

    6_3_X: https://github.com/appcelerator/titanium_mobile/pull/9711
  3. Abir Mukherjee 2018-01-10

    Passed FR.
  4. Eric Merriman 2018-08-06

    Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.

JSON Source