I have had the worst two days. Here I have my app, Notiffi, pretty much ready to go. I have it set up in iTunes connect, ready to go. I am ready for the last step in the process, archiving. I hit Archive and BOOM. Nothing. Build works. Debug works. Archive does not work, and it still doesn’t as I’m writing this. Also, suddenly I start getting linker errors like this when I was building it and so I couldn’t even check to see if the app worked any more.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | (null): "_OBJC_CLASS_$_CDVPlugin", referenced from: (null): _OBJC_CLASS_$_ChildBrowserCommand in ChildBrowserCommand.o (null): _OBJC_CLASS_$_PushNotification in PushNotification.o (null): "_OBJC_CLASS_$_CDVViewController", referenced from: (null): _OBJC_CLASS_$_MainViewController in MainViewController.o (null): "_OBJC_METACLASS_$_CDVPlugin", referenced from: (null): _OBJC_METACLASS_$_ChildBrowserCommand in ChildBrowserCommand.o (null): _OBJC_METACLASS_$_PushNotification in PushNotification.o (null): "_OBJC_CLASS_$_CDVPluginResult", referenced from: (null): Objc-class-ref in PushNotification.o (null): "_OBJC_METACLASS_$_CDVViewController", referenced from: (null): _OBJC_METACLASS_$_MainViewController in MainViewController.o (null): Symbol(s) not found for architecture armv7 (null): Linker command failed with exit code 1 (use -v to see invocation) |
While Archiving (at the moment) still isn’t working I did find a way to get the linker errors to go away. I presume that it was because of some incorrect paths in Xcode, but I’m a PHP, Java, HTML and JavaScript developer and so compiler issues on a Mac with Xcode are things that I know a lot about. Linux? Sure. Mac/Xcode? Not a bit.
But my workaround for this was relatively easy. I removed CordovaLib as a subproject and built it separately. Then I did find ./ -name libCordova.a on my home directory, created a new dir called /lib in my project and copied libCordova.a there. I cleaned the project, rebuilt and and voila! it worked.
Now on to fix the Archiving problem. For some reason I get this
1 | Command /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng emitted errors but did not return a nonzero exit code to indicate failure |
and
1 | /Users/tk421/Documents/Notiffi/Notiffi/Plugins/ChildBrowserCommand.h:5:9: 'Cordova/CDVPlugin.h' file not found |
Hopefully these will be easy issues
[UPDATE]
They were not easy issues. I basically created a brand new Cordova project and copied all of my source files in. Clearly there was something wrong in my build configuration, but I don’t know what it was.
