I am having trouble using assets that belong to a widget. On SDK 3.2.0 (Studio 18.104.22.168312191547) I am creating a widget and adding assets to the following path:
I am following the app level assets structure as indicated in the Alloy Widgets guide: http://docs.appcelerator.com/titanium/3.0/#!/guide/Alloy_Widgets
When I attempt to use my image asset I have tried many different paths but cannot get the image to show up within the app. In SDK 3.1.3 I used "/images/user/MyWidget/user.png" as the path in the tss and it worked. Now in 3.2.0 I cannot get this to work. I have also tried using WPATH('images/user/user.png'), this also is not working.
I do not think that the images folder is merging correctly in the Resources directory. I have attached an image of the resulting directories in Resources, both the android and iphone folders are dropping into Resources\android and not getting merged with the existing Resources\images folder. So the path to the widget images is then Resources\android\android\images[res-hdpi|res-mdpi]\user\MyWidget\user.png . Notice the double layering of android folders. Correct me if I am wrong here but I am pretty sure the build should be merging "\MyWidget\assets\android\images" with "\app\assets\android\images"?
Please advise as to how I am supposed to be able to consume a widget asset image. I have attached a sample widget that I have been playing with. Also an image of the resulting folder structure in Resources.
I cannot get the images to show up via android or iOS.
1.Create New Ti Sample alloy project
2.Download the attachment and paste the files to app or import the downloaded files
3.Run the app and Check console
Titanium Command-Line Interface, CLI version 3.2.1, Titanium SDK version 3.2.0.GA
Copyright (c) 2012-2014, Appcelerator, Inc. All Rights Reserved.
Please report bugs to http://jira.appcelerator.org/
[INFO] : Found Titanium plugin id=ti.alloy version=1.0
[INFO] : Deploy type: development
[INFO] : Building for target: simulator
[INFO] : Building using iOS SDK: 7.0.3
[INFO] : Building for iOS iPhone Simulator: 7.0.3
[INFO] : Building for device family: universal
[INFO] : Minimum iOS version: 6.0
[INFO] : Debugging disabled
[INFO] : Profiler disabled
[INFO] : Initiating prepare phase
[INFO] : Found Alloy app in /Users/rmitro/Documents/Titanium_Studio_Workspace/helpdesk2/app
[INFO] : Executing Alloy compile: /usr/local/bin/node /usr/local/bin/alloy compile /Users/rmitro/Documents/Titanium_Studio_Workspace/helpdesk2/app --config platform=ios,version=0,simtype=none,devicefamily=universal,deploytype=development
[INFO] : ----- MVC GENERATION -----
[INFO] : [global style] loading from cache...
[INFO] : [index.xml] view processing...
[INFO] : style: "index.tss"
[INFO] : view: "index.xml"
[INFO] : controller: "index.js"
[INFO] : created: "Resources/iphone/alloy/controllers/index.js"
[INFO] : created: "Resources/iphone/alloy/styles/index.js"
[INFO] : [app.js] using cached app.js...
[INFO] : ----- OPTIMIZING -----
[INFO] : - iphone/alloy.js
[INFO] : - iphone/alloy/sync/localStorage.js
[INFO] : - iphone/alloy/sync/properties.js
[INFO] : - iphone/alloy/sync/sql.js
[INFO] : - iphone/alloy/widgets/com.appcelerator.loading/controllers/widget.js
[INFO] : - iphone/alloy/widgets/com.appcelerator.loading/styles/widget.js
[INFO] : Alloy compiled in 0.65125s
[INFO] : Alloy compiler completed successfully
[INFO] : Initiating Xcode pre-compile phase
[INFO] : Skipping xcodebuild
[INFO] : Finished building the application in 4s 321ms
[INFO] : Running application in iOS Simulator
[INFO] : Launching application in iOS Simulator
[INFO] : Focusing the iOS Simulator
[INFO] : Application started
[INFO] : helpdesk2/1.0 (3.2.0.GA.d9182d6)
[ERROR] : Script Error