Titanium Community Questions & Answer Archive

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

Extending Titanium Mobile with Module SDK possible?

I read this document:
http://developer.appcelerator.com/doc/mobile/iphone/module_sdk

I cannot get it to work with 1.3.2 and Xcode 3.2.3. After creating my project from xcode using Appcelerator/Titanium Mobile Module template, I get the example code, but it complains about the "Base SDK Missing". So I edit the project settings and update the Base SDK from 3.1.3 to 3.2, then I edit the manifest, type '% python build.py' :

http://gist.github.com/491513

I unzip this to /Library/Application Support/Titanium, update my modules in tiapp.xml, as instructed, but it the simulator never starts up. Weird.

http://gist.github.com/491515

So it is loading 'myphonenumber/0.1' but doesn't go any further.

Is there a log somewhere I can read to get more info when things break? Ah ha, found build.log:

Undefined symbols:
"_ADBannerContentSizeIdentifier320x50", referenced from:
_ADBannerContentSizeIdentifier320x50$non_lazy_ptr in TiUIiOSAdViewProxy.o
(maybe you meant: _ADBannerContentSizeIdentifier320x50$non_lazy_ptr)
"_OBJCCLASS$_ADBannerView", referenced from:
objc-class-ref-to-ADBannerView in TiUIiOSAdView.o
"_ADBannerContentSizeIdentifier480x32", referenced from:
_ADBannerContentSizeIdentifier480x32$non_lazy_ptr in TiUIiOSAdViewProxy.o
(maybe you meant: _ADBannerContentSizeIdentifier480x32$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status

Not sure how to fix this?

— asked July 26th 2010 by Alex Shah
  • 1.3.2
  • iphone
  • module
  • osx
0 Comments

3 Answers

  • I am running into the exact same bug, using the 1.4.0 Titanium SDK release, and iOS SDK 4, when trying a base case of building the Clipboard SDK extension module in with my newly created app. As a sanity check, both are 100% unmodified from the defaults (e.g. my app is a stock new project created in Titanium Developer, and with the clipboard module I just changed it to build up against 1.4.0 instead of 1.3.0).

    The clipboard SDK extension module I am talking about is at: http://github.com/xavierlacot/titanium_mobile_clipboard_module

    (I'll be gutting it and replacing it with EventKit logic once I can get past this bug)

    Any help for us would be greatly appreciated! Will have to write a native app if I can't figure this out, as I need eventkit functionality….:/

    — answered July 28th 2010 by Robby Dermody
    permalink
    2 Comments
    • I have been trying to create a module to use the Event Kit over the last few days and found exactly the same issue. Is there anything else to try?

      I am using SDK 1.4 building for ios4

      The error I get is:
      Undefined symbols:
      "OBJC_CLASS$_EKEventStore", referenced from:
      objc-class-ref-to-EKEventStore in libcalendar.a(CalendarModule.o)
      "OBJC_CLASS$_EKEvent", referenced from:
      objc-class-ref-to-EKEvent in libcalendar.a(CalendarModule.o)
      ld: symbol(s) not found
      collect2: ld returned 1 exit status

      This may be down to my module as I have never used Objective C before and have just been cutting and pasting what I have found in Appcelerator and Apple documentation. If it is of any use the code is as follows:

      CalendarModule.h :-

      import "TiModule.h"
      @interface CalendarModule : TiModule { }
      @end
      

      CalendarModule.m :-

      import "CalendarModule.h"
      import "TiBase.h"
      import "TiHost.h"
      import "TiUtils.h"
      import <EventKit/EventKit.h>
      @implementation CalendarModule
      pragma mark Lifecycle
      -(void)startup {
      [super startup];
      NSLog(@"[INFO] %@ loaded",self);
      }
      -(void)shutdown:(id)sender {
      [super shutdown:sender];
      }
      pragma mark Cleanup
      -(void)dealloc {
      [super dealloc];
      }
      pragma mark Internal Memory Management
      -(void)didReceiveMemoryWarning:(NSNotification*)notification {
      [super didReceiveMemoryWarning:notification];
      }
      pragma mark Listener Notifications
      -(void)_listenerAdded:(NSString *)type count:(int)count {
      if (count == 1 && [type isEqualToString:@"my_event"])
      {
      }
      }
      -(void)_listenerRemoved:(NSString *)type count:(int)count {
      if (count == 0 && [type isEqualToString:@"my_event"])
      {
      }
      }
      pragma Public APIs
      -(id)newevent:(id)args {
      id arg1 = [args objectAtIndex:0];  // Start Date
      id arg2 = [args objectAtIndex:1];  // End Date
      id arg3 = [args objectAtIndex:2];  // Title
      id arg4 = [args objectAtIndex:3];  // Location
      id arg5 = [args objectAtIndex:4];  // Text
      
      NSDateFormatter *df = [[NSDateFormatter alloc] init];
      [df setDateFormat:@"yyyy-MM-dd hh:mm:ss"];
      NSDate *startdate = [df dateFromString: arg1];
      NSDate *enddate = [df dateFromString: arg2];
      
      EKEventStore *eventStore = [[[EKEventStore alloc] init] autorelease];
      
      EKEvent *event  = [EKEvent eventWithEventStore:eventStore];
      
      event.title     = arg3;
      event.location  = arg4;
      event.notes     = arg5;
      event.startDate = startdate;
      event.endDate   = enddate;
      
      [event setCalendar:[eventStore defaultCalendarForNewEvents]];
      NSError *err;
      [eventStore saveEvent:event span:EKSpanThisEvent error:&err];
      
      return event.eventIdentifier;
      
      }
      
      @end
      

      — commented August 10th 2010 by Derrick Huth
    • You need to delete the comments as referred to above, there is a new builder in a different directory, sorry can't remember the path but it is easy to search for.

      If you need to import a framework use the following code:

      Added the following line to module.xcconfig, OTHER_LDFLAGS=$(inherited) -framework EventKit.

      It now works perfectly

      — commented August 11th 2010 by Derrick Huth
  • See this ticket

    #
    # PLACE ANY BUILD DEFINITIONS IN THIS FILE AND THEY WILL BE 
    # PICKED UP DURING THE APP BUILD FOR YOUR MODULE
    #
    

    Delete this code from module.xcconfig. Comments should use double slash (//).

    — answered August 4th 2010 by Lukasz Radziwonowicz
    permalink
    0 Comments
  • I created my own module under 1.3.0 templates and I could compile, link, and run with appcelerator.

    But i can't get the same module to run against 1.4.0.

    Do I need to install new template from 1.4.0? There is a new install.py (in a different directory path then 1.3.0). I'm not sure what that is doing yet.

    — answered August 9th 2010 by Robert Logan
    permalink
    0 Comments
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.