Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25081

Android: Uncaught TypeError: Cannot use 'in' operator to search for 'Resources/alloy' in null.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: None
    • Resolution: Fixed
    • Affects Version/s: Release 6.1.2
    • Fix Version/s: Release 6.3.0
    • Component/s: Android
    • Labels:
      None
    • Environment:
    • Story Points:
      3
    • Sprint:
      2018 Sprint 01 SDK

      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
      	}
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                jnaher Jebun Naher
              • Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-10974
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code