{ "id": "62040", "key": "TIMOB-1408", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-04-15T02:51:31.000+0000", "created": "2011-04-15T02:51:26.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "module", "obj-c", "sdk" ], "versions": [], "issuelinks": [], "assignee": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-09T23:17:40.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}

SDK 1.4.0, iOS SDK 4.0.1, XCode 3.2.3
\nWhen attempting to build a stock new project with a very basic\nTitanium SDK extension module (http://github.com/xavierlacot/titanium_mobile_clipboard_module),\nI get the following linking error:

\n
\nLd build/Debug-iphonesimulator/SCApp.app/SCApp normal i386\n    cd \"/Users/jamie/Documents/Aptana Studio Workspace/myprojmyproj/SCApp/build/iphone\"\n    setenv MACOSX_DEPLOYMENT_TARGET 10.6\n    setenv PATH \"/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin\"\n    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk \"-L/Users/jamie/Documents/Aptana Studio Workspace/myproj/SCApp/build/iphone/build/Debug-iphonesimulator\" \"-L/Users/jamie/Documents/Aptana Studio Workspace/myproj/SCApp/build/iphone/lib\" \"-L/Library/Application Support/Titanium/modules/iphone/titanium.clipboard/0.1\" \"-L/Library/Application Support/Titanium/modules/iphone/titanium.ekext/0.1\" \"-L/Users/jamie/Documents/Aptana Studio Workspace/myproj/SCApp/build/iphone/../../../../tmp/debug/build\" \"-L/Users/jamie/Documents/Aptana Studio Workspace/myproj/SCApp/build/iphone/../../../../tmp/staticlib/build/Debug-iphonesimulator\" \"-L/Users/jamie/Documents/Aptana Studio Workspace/myproj/SCApp/build/iphone/../../../tijs/TiCore/TiCore/build/Release-iphonesimulator\" \"-F/Users/jamie/Documents/Aptana Studio Workspace/myproj/SCApp/build/iphone/build/Debug-iphonesimulator\" -filelist \"/Users/jamie/Documents/Aptana Studio Workspace/myproj/SCApp/build/iphone/build/SCApp.build/Debug-iphonesimulator/SCApp.build/Objects-normal/i386/SCApp.LinkFileList\" -mmacosx-version-min=10.6 -ObjC -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -weak_framework UIKit -framework CoreGraphics -framework AddressBook -framework AddressBookUI -framework CFNetwork -framework CoreLocation -framework MapKit -framework MessageUI -framework MobileCoreServices -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -lsqlite3 -lz -framework AudioToolbox -weak_framework MediaPlayer -framework AVFoundation -lxml2 -framework StoreKit -lTiCore -ltitanium.clipboard -ltitanium.ekext -framework ExternalAccessory -ltiverify -o \"/Users/jamie/Documents/Aptana Studio Workspace/myproj/SCApp/build/iphone/build/Debug-iphonesimulator/SCApp.app/SCApp\"\n\nld: warning: directory '/Users/jamie/Documents/Aptana Studio Workspace/myproj/SCApp/build/iphone/../../../../tmp/debug/build' following -L not found\nld: warning: directory '/Users/jamie/Documents/Aptana Studio Workspace/myproj/SCApp/build/iphone/../../../../tmp/staticlib/build/Debug-iphonesimulator' following -L not found\nld: warning: directory '/Users/jamie/Documents/Aptana Studio Workspace/myproj/SCApp/build/iphone/../../../tijs/TiCore/TiCore/build/Release-iphonesimulator' following -L not found\nUndefined symbols:\n  \"_ADBannerContentSizeIdentifier320x50\", referenced from:\n      _ADBannerContentSizeIdentifier320x50$non_lazy_ptr in TiUIiOSAdViewProxy.o\n     (maybe you meant: _ADBannerContentSizeIdentifier320x50$non_lazy_ptr)\n  \"_OBJC_CLASS_$_ADBannerView\", referenced from:\n      objc-class-ref-to-ADBannerView in TiUIiOSAdView.o\n  \"_ADBannerContentSizeIdentifier480x32\", referenced from:\n      _ADBannerContentSizeIdentifier480x32$non_lazy_ptr in TiUIiOSAdViewProxy.o\n     (maybe you meant: _ADBannerContentSizeIdentifier480x32$non_lazy_ptr)\nld: symbol(s) not found\ncollect2: ld returned 1 exit status\n
\n

Both I and another individual ran into this same error with two\nrecent versions of Titanium SDK (1.3.2 and 1.4.0). For the full\nerror and process, please see:
\n\nhttp://developer.appcelerator.com/question/46541/extending-titanium...

\n

Also, when adding an extension module up against a titanium app,\nand launching the app in the emulator, the build scripts seem to\nwant to recompile the whole Titanium libraries every\ntime…making it take 5+ minutes every time I try to build the\napp (maybe this is just because of the linking problem above).

{html}", "attachment": [ { "id": "17982", "filename": "ek.zip", "author": { "name": "des", "key": "des", "displayName": "Des", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:51:27.000+0000", "size": 789291, "mimeType": "application/zip" }, { "id": "17981", "filename": "st-johns.zip", "author": { "name": "des", "key": "des", "displayName": "Des", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:51:27.000+0000", "size": 127723, "mimeType": "application/zip" } ], "flagged": false, "summary": "iAd's related linking failure when building an app with a custom titanium extension module", "creator": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "125570", "author": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

It looks like just adding \"-framework iAd\" into that linking\nstatement will resolve the error. Now I just need to find where in\nthe Titanium codebase that linking statement is being assembled....\n:o

{html}", "updateAuthor": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:51:27.000+0000", "updated": "2011-04-15T02:51:27.000+0000" }, { "id": "125571", "author": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Note that this appears to be a side-effect to the issue\nidentified in ticket #1339. Commenting out that line fixes this issue\nand allows the build to succeed.

{html}", "updateAuthor": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:51:28.000+0000", "updated": "2011-04-15T02:51:28.000+0000" }, { "id": "125572", "author": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

The issue of a full Titanium rebuild every time I make an app\nrevision still persists however...perhaps it's that \"force_xcode =\nTrue\" in iphone/builder.py on line 478?? Is there a particular\nreason for having to rebuild everything? This makes test/debug\ncycles unbearably long (5-10 minutes, instead of the normal

\n

I'd really like to use Titanium but if I have to have 5-10\nminute rebuild cycles every time I'll have to just write this app\nnatively. :/

{html}", "updateAuthor": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:51:28.000+0000", "updated": "2011-04-15T02:51:28.000+0000" }, { "id": "125573", "author": { "name": "jakehowerton", "key": "jakehowerton", "displayName": "Jake Howerton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

One part of the issue which resolves my original ticket is that\nthe comment banner at the top of the automatically generated\nmodule.xcconfig creates a syntax error. Comments should use double\nslash (//) in xcconfig files

\n

Remove:

\n
\n#\n# PLACE ANY BUILD DEFINITIONS IN THIS FILE AND THEY WILL BE \n# PICKED UP DURING THE APP BUILD FOR YOUR MODULE\n#\n
{html}", "updateAuthor": { "name": "jakehowerton", "key": "jakehowerton", "displayName": "Jake Howerton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:51:28.000+0000", "updated": "2011-04-15T02:51:28.000+0000" }, { "id": "125574", "author": { "name": "jakehowerton", "key": "jakehowerton", "displayName": "Jake Howerton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

After fixing the comment issue above and then wiping out my\nbuild folder entirely, I can successfully build with the\n-weak_framework flags

{html}", "updateAuthor": { "name": "jakehowerton", "key": "jakehowerton", "displayName": "Jake Howerton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:51:28.000+0000", "updated": "2011-04-15T02:51:28.000+0000" }, { "id": "125575", "author": { "name": "des", "key": "des", "displayName": "Des", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I have been trying to create a module to use the Event Kit over\nthe last few days and found exactly the same issue. Both of the\ntips above have not helped. Is there anything else to try?

\n

The error I get is:

\n

Undefined symbols:
\n\"OBJC_CLASS$_EKEventStore\", referenced from:

\n
\n  objc-class-ref-to-EKEventStore in libcalendar.a(CalendarModule.o)\n
\n

\"OBJC_CLASS$_EKEvent\", referenced from:

\n
\n  objc-class-ref-to-EKEvent in libcalendar.a(CalendarModule.o)\n
\n

ld: symbol(s) not found
\ncollect2: ld returned 1 exit status

\n

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

\n

CalendarModule.h :-

\n

import \"TiModule.h\"

\n

@interface CalendarModule : TiModule { }

\n

@end

\n

CalendarModule.m :-

\n

import \"CalendarModule.h\"

\n

import \"TiBase.h\"

\n

import \"TiHost.h\"

\n

import \"TiUtils.h\"

\n

import <EventKit/EventKit.h>

\n

@implementation CalendarModule

\n

pragma mark Lifecycle

\n

-(void)startup {

\n
\n[super startup];\nNSLog(@\"[INFO] %@ loaded\",self);\n
\n

}

\n

-(void)shutdown:(id)sender {

\n
\n[super shutdown:sender];\n
\n

}

\n

pragma mark Cleanup

\n

-(void)dealloc {

\n
\n[super dealloc];\n
\n

}

\n

pragma mark Internal Memory Management

\n

-(void)didReceiveMemoryWarning:(NSNotification*)notification\n{

\n
\n[super didReceiveMemoryWarning:notification];\n
\n

}

\n

pragma mark Listener Notifications

\n

-(void)_listenerAdded:(NSString *)type count:(int)count {

\n
\nif (count == 1 && [type isEqualToString:@\"my_event\"])\n{\n}\n
\n

}

\n

-(void)_listenerRemoved:(NSString *)type count:(int)count {

\n
\nif (count == 0 && [type isEqualToString:@\"my_event\"])\n{\n}\n
\n

}

\n

pragma Public APIs

\n

-(id)newevent:(id)args {

\n
\nid arg1 = [args objectAtIndex:0];  // Start Date\nid arg2 = [args objectAtIndex:1];  // End Date\nid arg3 = [args objectAtIndex:2];  // Title\nid arg4 = [args objectAtIndex:3];  // Location\nid arg5 = [args objectAtIndex:4];  // Text\n\nNSDateFormatter *df = [[NSDateFormatter alloc] init];\n[df setDateFormat:@\"yyyy-MM-dd hh:mm:ss\"];\nNSDate *startdate = [df dateFromString: arg1];\nNSDate *enddate = [df dateFromString: arg2];\n\nEKEventStore *eventStore = [[[EKEventStore alloc] init] autorelease];\n\nEKEvent *event  = [EKEvent eventWithEventStore:eventStore];\n\nevent.title     = arg3;\nevent.location  = arg4;\nevent.notes     = arg5;\nevent.startDate = startdate;\nevent.endDate   = enddate;\n\n[event setCalendar:[eventStore defaultCalendarForNewEvents]];\nNSError *err;\n[eventStore saveEvent:event span:EKSpanThisEvent error:&err];\n\nreturn event.eventIdentifier;\n
\n

}

\n

@end

{html}", "updateAuthor": { "name": "des", "key": "des", "displayName": "Des", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:51:29.000+0000", "updated": "2011-04-15T02:51:29.000+0000" }, { "id": "125576", "author": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Des,

\n

hmm, check your compiler build strings. Is it trying to link to\nthe Eventkit framework? If not, you should remove those # comments\nthat ticket #1339 talks about. Then, add a -framework switch\nfor eventkit in your module's OTHER_LDFLAGS variable (I think\nOTHER_LDFLAGS is right...forget the exact named, and it should be\nin a file called module.xcconfig ..which is xconfig-specific\nparameters for your project)

\n

I'll be going through this here in a few days, so let me know\nhow it turns out.

{html}", "updateAuthor": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:51:29.000+0000", "updated": "2011-04-15T02:51:29.000+0000" }, { "id": "125577", "author": { "name": "des", "key": "des", "displayName": "Des", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Dear Robby,

\n

Sorry for the delay replying, I have had 24 hours of hair\npulling. My previous attempt was such a messed up bodge (using sdk\n1.4 with the 1.3.2 module builder as it had moved, modified\nbuild.py and builder.py, every conceivable setting in xcode messed\nabout....) so I thought I would start from scratch with a clean\nmodule.

\n

Deleted 1.4 and re-downloaded, used it's module builder, deleted\nthe # comments and recreated the module from scratch. Added the\nfollowing line to module.xcconfig, OTHER_LDFLAGS=$(inherited)\n-framework EventKit.

\n

And it didnt work. I have been trying everything and\neventually realised that I am a complete idiot! I wanted to leave\nmy original module there for reference (it was called Calendar) so\nI created a new module called EK (completely forgetting Titanium's\nnaming requirements). Once all references to EK were changed to Ek\nit works perfectly. It doesnt do much, but it does let me\nput events into the iPhone Calendar and shouldnt be very hard\nto extend.

\n

Thanks very much for the help.

{html}", "updateAuthor": { "name": "des", "key": "des", "displayName": "Des", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:51:30.000+0000", "updated": "2011-04-15T02:51:30.000+0000" }, { "id": "125578", "author": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Hey Des,

\n

Glad you got it working!

\n

Would you be able to send me the module you made by chance (that\nor put it on github, etc)? I'm going to be doing this myself for my\napp and it would save me a lot of time. I'd be happy to send you\nback any additions.

\n

Robby

{html}", "updateAuthor": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:51:30.000+0000", "updated": "2011-04-15T02:51:30.000+0000" }, { "id": "125579", "author": { "name": "des", "key": "des", "displayName": "Des", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Dear Robby,

\n

Attached are two files, the module EK.zip and a simple titanium\nproject that lets you add and inspect calendar events\nStJohns.zip

\n

It is really just a proof of concept at the moment as I know\nthat I will need it for an app that I plan to start working on in\nthe next month or so. Please note that this is no use in the\nemulator as it appears not to support the calendar at all, you have\nto install on a phone.

\n

There is a bit of fiddling required to get it going, but I think\nthis ticket could now be reduced to a faq.

\n

I am not too concerned about the full rebuild, having got the\nfunctionality required in the module working I will comment out the\nentry in tiapp.xml and work on the rest of the app, just\nuncommenting every now and then to do a test build.

\n

Best wishes

\n

Des

{html}", "updateAuthor": { "name": "des", "key": "des", "displayName": "Des", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:51:30.000+0000", "updated": "2011-04-15T02:51:30.000+0000" }, { "id": "125580", "author": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Thanks Des for the files. Much appreciated.

{html}", "updateAuthor": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:51:31.000+0000", "updated": "2011-04-15T02:51:31.000+0000" }, { "id": "125581", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Unable to duplicate as described. Probably an issue with the\nexternal module at some point. 1.6.0 RC1.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:51:31.000+0000", "updated": "2011-04-15T02:51:31.000+0000" }, { "id": "410969", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T23:17:40.000+0000", "updated": "2017-03-09T23:17:40.000+0000" } ], "maxResults": 13, "total": 13, "startAt": 0 } } }