[TIMOB-25081] Android: Uncaught TypeError: Cannot use 'in' operator to search for 'Resources/alloy' in null.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-01-10T22:33:27.000+0000 |
Affected Version/s | Release 6.1.2 |
Fix Version/s | Release 6.3.0 |
Components | Android |
Labels | n/a |
Reporter | Jebun Naher |
Assignee | Gary Mathews |
Created | 2017-08-10T10:35:06.000+0000 |
Updated | 2018-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
}
}
This should be fixed by TIMOB-25242
6_3_X: https://github.com/appcelerator/titanium_mobile/pull/9711
Passed FR.
Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.