Titanium JIRA Archive
Appcelerator Community (AC)

[AC-135] Accessing controllers inside folders in Alloy using <Require src> causes problems in runtime

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2015-11-13T18:53:31.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy, Studio
Labelsn/a
ReporterEric Cheung
AssigneeShak Hossain
Created2015-05-22T22:17:36.000+0000
Updated2015-11-13T18:53:31.000+0000

Description

I'm trying to build a simple Alloy App with a folder structure inside the views/styles/controllers, for organization purposes.. {{app - controllers - - folder - - - somecontroller.js - styles - - folder - - - somecontroller.tss - views - - folder - - - somecontroller.xml}} In the XML, when using a to refer to a controller, this seems to cause an error when I run the app. The app returns the error on runtime: [ERROR] : Script Error Couldn't find module: alloy/controllers/folder/somecontroller for architecture: arm64 If I take the folder structure out of the views/styles/controllers and leave the .xml/.tss/.js in the top level folders, change the path of the app runs fine. It seems like when building the app, the files inside the folders are not included.

Attachments

FileDateSize
app.zip2015-05-23T00:30:10.000+00004595
app2.zip2015-05-23T00:32:33.000+00005184
iOS Simulator Screen Shot May 22, 2015, 8.32.14 PM.png2015-05-23T00:35:44.000+000023862
iOS Simulator Screen Shot May 22, 2015, 8.32.31 PM.png2015-05-23T00:33:52.000+000078220

Comments

  1. Radamantis Torres-Lechuga 2015-05-22

    Hello [~echeung@leviton.com] can you please attach a test case?
  2. Eric Cheung 2015-05-23

    Attached is the sample source files with a /windows inside /views, /styles and /controllers. Two controllers were created: mainwindow and helpwindow index.js contains a tab group with 2 tabs. The tabs are loading the window via with src set to the /windows directory to load the mainwindow.xml and helpwindow.xml
  3. Eric Cheung 2015-05-23

    Attached is the sample source files without a subfolder inside /views, /styles and /controllers. Two controllers were created: mainwindow and helpwindow index.js contains a tab group with 2 tabs. The tabs are loading the window via with src pointing to the mainwindow.xml and helpwindow.xml without them being nested inside a folder
  4. Eric Cheung 2015-05-23

    The screenshot of the iOS simulator running the app with the loading the controller inside a folder. (error pops up after starting the app past the splash screen)
  5. Eric Cheung 2015-05-23

    The screenshot of the iOS simulator running the app with the loading the controller that isn't inside a folder. No issues
  6. Rob Trueman 2015-05-27

    I'm having the same issue when running my app on the iPhone 6. Surprisingly, I'm able to successfully run the app using the iOS Simulator - iPhone 6. My app is an Alloy app with view/models/controllers in a folder structure under app.
  7. Rakhi Mitro 2015-09-14

    Hello, Tested this issue. This is not a valid bug, working expected in the simulator. *Test Environments:* CLI Version :4.1.3 Titanium SDK Version:4.1.1.GA Simulator:iPhone 6,iOS SDK: 8.2 Appc Studio: Appcelerator Studio, build: 4.1.1.201507141126 Alloy: 1.7.6 Mac OS X,Version = 10.10.1 *Test Steps:*

    Copy customer’s code to app directory.

    Go to *app>controllers>Rename the Windows folder* as *tests*

    Repeat step 2 for views and styles folder.

    Run Project.

    *Test Code:* *index.xml*
       
       <Alloy>
       	<TabGroup class="container">
       		<Tab title="main">
       			<Require src="tests/mainwindow"/>
       		</Tab>
       		<Tab title="help">
       			<Require src="tests/helpwindow"/>
       		</Tab>
       	</TabGroup>
       </Alloy>
       
    *index.js*
       
       $.index.open();
       
       
    *mainwindow.xml*:
       <Alloy>
       	<Window class="container">
       		<View>
       			<Label text="Main page"/>
       		</View>
       	</Window>
       </Alloy>
       
    *helpwindow.xml*:
       
       <Alloy>
       	<Window class="container">
       		<View>
       			<Label text="Help page"/>
       		</View>
       	</Window>
       </Alloy>
       
    *Test Result:* [Project | http://i57.tinypic.com/rs6ept.png] is running successfully without any error. Here is console log:
       
       [INFO] :   Initiating Xcode pre-compile phase
       [INFO] :   Processing JavaScript files
       [INFO] :   Processing Titanium namespace resources
       [INFO] :   Skipping xcodebuild
       [INFO] :   Finished building the application in 1s 91ms
       [INFO] :   Launching iOS Simulator
       [INFO] :   Project built successfully in 15s 498ms
       -- Start simulator log -------------------------------------------------------
       [INFO] :   Application started
       [INFO] :   AC135/1.0 (4.1.0.d57aa7d)
       
    Thanks
  8. Eric Cheung 2015-09-15

    As Rob experienced, It seems like I was able to get it working on the iOS simulator. But on an actual device (iPhone 5S) It does not work. Please change the test case to use an actual device.
  9. Rakhi Mitro 2015-09-16

    Tested on actual device and it works as per details below. *Test Environments:* CLI Version :4.1.3 Titanium SDK Version:4.1.1.GA, Appc Studio: Appcelerator Studio, build: 4.1.1.201507141126 Alloy: 1.7.6 Mac OS X,Version = 10.10.1. Device:iPad,iPod 5G *iPad logs:*
       [INFO] :   Installing app on device: iPad
       
       [INFO] :   App successfully installed on device: iPad
       
       [INFO] :   Project built successfully in 11s 242ms
       
       Please manually launch the application
       
       -- Start application log -----------------------------------------------------
       
       [INFO] :   com.gsl.ac135alloy/1.0 (0.0.0.7e39876)
       
       [LiveView] Client connected
       
       
    *iPod 5G logs:*
       [INFO] :   Installing app on device: iPod 5G
       
       [INFO] :   App successfully installed on device: iPod 5G
       
       [INFO] :   Project built successfully in 13s 649ms
       
       Please manually launch the application
       
       -- Start application log -----------------------------------------------------
       
       [INFO] :   com.gsl.ac135alloy/1.0 (0.0.0.7e39876)
       
       
    Thanks

JSON Source