Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

"Couldn't find" custom module

I'm working on adding a custom module to my Titanium iPhone app. I have an example module that works fine, but I consistently get "Couldn't find module" errors when I load the window that would instantiate mine.

This is the relevant section of my tiapp.xml file:

<modules>
  <!--module version="0.1">ti.barcode</module-->
  <module version="0.1">zbarmodule</module>
</modules>

The commented-out line is for the example module I got from the kind Jeff Haynie. If I uncomment that and comment out line the zbarmodule line (and force a full rebuild), the project builds fine.

I'm using the 1.3.3 SDK and I built the module using the Appcelerator XCode template. There's not much to it besides one method and some linked binaries, and there are no errors when I build and install it. The contents of its manifest are as follows:

name: ZBarModule
moduleid: zbarmodule
version: 0.1
description: ZBar Titanium Module
author: Brendan Adkins
license: Full Copyright
copyright: Copyright (c) 2010 DevelopmentNow
platform: iphone
minsdk: 1.3.2

The module is installed at /Library/Application Support/Titanium/modules/iphone/zbarmodule. Here's the contents of the file where it's being called:

var win = Titanium.UI.currentWindow;
Ti.Zbar = require("zbarmodule");

That's really all there is to it, but here's the error I get when I build and compile the project:

>APPLICATION ERROR. Couldn't find module: zbarmodule

I've tried every capitalization I can think of, as well as removing the "module" like it says in the old documentation. I've also tried the old method of just accessing it via Titanium.Zbar or Titanium.Zbarmodule, but I'm going off of this recent thread about how to instantiate modules in the new SDK.

Am I just missing some magic word, or do I need to use a different notation in the manifest?

— asked July 21st 2010 by Brendan Adkins
2 Comments
  • Hi

    Have you tried cleaning out your project (Project -> Clean) and then rebuilding? I find that worked for me with this issue.

    — commented January 3rd 2012 by Marc Chee
  • This worked for me: (Project -> Clean) and then rebuilding.

    — commented November 6th 2012 by Benjamin Madsen

5 Answers

  • I should add that Developer does show "[INFO] Detected third-party module: zbarmodule/0.1" when I hit the launch button. (For some reason it always stops once the project is built, however, and I have to go into XCode and use the Build-and-Run button directly.)

    — answered July 21st 2010 by Brendan Adkins
    permalink
    0 Comments
  • Sorry double posted

    — answered July 25th 2010 by Yuichiro MASUI
    permalink
    0 Comments
  • I had same problem and I figured out.

    Ti.Zbar = require("ZBarModule");
    is correct.

    I uploaded my camera module for HEAD.
    http://github.com/masuidrive/TiCustomCamera

    — answered July 25th 2010 by Yuichiro MASUI
    permalink
    0 Comments
  • Hi Brendan,

    have you solved your problem? We developed a similar module and faced those problems as well. After we figured out how to get all running we decided to write a detailed tutorial on writing modules besed on third party libraries, which we will release nest week. You might want to check out our barcode titanium module TiBar for iPhone Apps which is based on ZBar as well. Thanks.

    — answered August 6th 2010 by Martin Lasak
    permalink
    0 Comments
  • Hello,

    I'am trying to work with ti.paint and I get the same error.

    On my mac the file tree structure is:

    &#x2F;Library&#x2F;Application Support&#x2F;Titanium&#x2F;modules&#x2F;iphone&#x2F;paint&#x2F;

    in this folder are manifest, module.xcconfig …

    During building line 611 says:
    Third-party module: ti.paint&#x2F;1.0 missing library at &#x2F;Library&#x2F;Application Support&#x2F;Titanium&#x2F;modules&#x2F;iphone&#x2F;paint&#x2F;libti.paint.a

    In fact – on my system is not such file and I ask me, who builds this lib.

    I downloaded the zip from git and copied in such manner that the project dates are in folder above.

    Whats going wrong?

    I dont know, which zip file is to copy in wich folder??

    Rainer

    — answered May 9th 2011 by Rainer Schleevoigt
    permalink
    1 Comment
    • the second one:

      You should see everything in :

      Library/Application Support/Titanium/modules/iphone/paint/1.0

      — commented May 9th 2011 by Kosso
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.