Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12792] Code Processor marks require of module by id as problem

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-03-29T00:05:51.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsCode Processor
Labelsn/a
ReporterChristopher Williams
AssigneeBryan Hughes
Created2013-02-20T16:27:06.000+0000
Updated2013-08-14T20:48:26.000+0000

Description

I tried running the code processor against a Titanium Mobile project on latest master build (3.1.0.v20130215185802). The project includes a require of the "com.soasta.touchtest" module. The line is returned as an error by the code processor:
The require path "/Users/cwilliams/workspaces/runtime-Titanium-360/sadfasdf/Resources/com.soasta.touchtest.js" could not be found
The module is inside the project at modules/iphone/com.soasta.touchtest

Comments

  1. Bryan Hughes 2013-02-20

    Did you run the code processor with "-o iphone"? Also can you check which version of the code processor you are running by opening the package.json file and looking at the version entry? The code processor is typically installed in /usr/local/lib/node_modules/titanium-code-processor on OS X and Linux.
  2. Christopher Williams 2013-02-20

    I'm running 0.3.1 with a couple hacks (two overwritten files) pinnamuri gave me to get it working when integrated with Studio. I ran it specifying "iphone" as the platform.
  3. Bryan Hughes 2013-02-20

    Just to verify: the require looks like:
       require('com.soasta.tocuhtest');
       
    and the module file is at 'Resources/iphone/com.soasta.tocuhtest.js' correct?
  4. Christopher Williams 2013-02-20

    I had a type in my description, just fixed it. The line of code is: var touchTestModule = require("com.soasta.touchtest"); The module is installed in the project at modules/iphone/com.soasta.touchtest I believe it is a native module. There is no Resources/iphone/com.soasta.touchtest.js file.
  5. Bryan Hughes 2013-02-20

    Can you check if it's native and, if so, that it's listed in the tiapp.xml? Native modules *must* be listed in the tiapp.xml file according to the docs and some of the people I talked to.
  6. Christopher Williams 2013-02-20

    Here's the relevant portion fo the tiapp.xml file. It's in there, and it's a native iphone module.
       <modules>
               <module platform="commonjs">ti.cloud</module>
               <module platform="iphone" version="1.0">com.soasta.touchtest</module>
           </modules>
           <deployment-targets>
               <target device="tizen">false</target>
               <target device="ipad">false</target>
               <target device="blackberry">false</target>
               <target device="android">true</target>
               <target device="iphone">true</target>
               <target device="mobileweb">true</target>
           </deployment-targets>
           <sdk-version>3.1.0.v20130215185802</sdk-version>
           <ios>
               <plist>
                   <dict>
                       <key>CFBundleURLTypes</key>
                       <array>
                           <dict>
                               <key>CFBundleTypeRole</key>
                               <string>Editor</string>
                               <key>CFBundleURLName</key>
                               <string>sfdafsd.asfdasdf</string>
                               <key>CFBundleURLSchemes</key>
                               <array>
                                   <string>touchtest-0b23a413-bf03-4982-a6bd-97ed596ee47b</string>
                               </array>
                           </dict>
                       </array>
                   </dict>
               </plist>
           </ios>
           <plugins>
               <plugin>com.soasta.touchtest.android</plugin>
           </plugins>
       
  7. Bryan Hughes 2013-02-20

    That's strange, that should work. Would you mind attaching your complete project (or a minimum working sample w/ tiapp.xml) so I can investigate further?
  8. Bryan Hughes 2013-02-21

    I ran the code processor on your project and it worked just fine for me. I used the command: titanium-code-processor analyze -o iphone --all-plugins -l debug What is the exact command that you ran? Also, those hacked files are out of date. You should go into the code processor and run "npm update" (with sudo if necessary) to pull the latest node-appc from NPM, which should work just fine without modification.

JSON Source