0

I am using the latest Cordova version in Mac Yosemite, using command line tools did the following

cordova create xxxx com.xxxx xxxx

cd xxxx

cordova platform add ios

now I open the xcode project file under platform and xcode 6 opens up

I then go to Build Setting -> Build Active Architecture Only -> No

Now I run the sample barebone cordova App and it throws a bunch of linker errors

ld: warning: ignoring file /Users/joelasirvathamjesudoss/Library/Developer/Xcode/DerivedData/xxxx-ehdvqzsskcnwbncktgdnuqbbnloq/Build/Products/Debug-iphonesimulator/libCordova.a, file was built for archive which is not the architecture being linked (i386): /Users/joelasirvathamjesudoss/Library/Developer/Xcode/DerivedData/xxxx-ehdvqzsskcnwbncktgdnuqbbnloq/Build/Products/Debug-iphonesimulator/libCordova.a
Undefined symbols for architecture i386:
  "_CDVLocalNotification", referenced from:
      -[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
  "_CDVPluginHandleOpenURLNotification", referenced from:
      -[AppDelegate application:openURL:sourceApplication:annotation:] in AppDelegate.o
  "_CDVRemoteNotification", referenced from:
      -[AppDelegate application:didRegisterForRemoteNotificationsWithDeviceToken:] in AppDelegate.o
  "_CDVRemoteNotificationError", referenced from:
      -[AppDelegate application:didFailToRegisterForRemoteNotificationsWithError:] in AppDelegate.o
  "_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from:
      _OBJC_CLASS_$_MainCommandDelegate in MainViewController.o
  "_OBJC_CLASS_$_CDVCommandQueue", referenced from:
      _OBJC_CLASS_$_MainCommandQueue in MainViewController.o
  "_OBJC_CLASS_$_CDVViewController", referenced from:
      _OBJC_CLASS_$_MainViewController in MainViewController.o
  "_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
      _OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
  "_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
      _OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
  "_OBJC_METACLASS_$_CDVViewController", referenced from:
      _OBJC_METACLASS_$_MainViewController in MainViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

But when I change Build Setting -> Build Active Architecture Only -> Yes Everything works fine.

Now I know while submitting to App Store Build Active Architecture Only should be No.

So please advice where I am going wrong

Settings look like the following Settings for Architectures Thanks in advance

joel
  • 747
  • 2
  • 9
  • 20

1 Answers1

0

Can you please confirm your setting looks like this ?

Mohammed Imran N
  • 1,279
  • 1
  • 11
  • 26
  • can you check all the .m files are added. Check compile sources in the build settings. This may help you http://stackoverflow.com/questions/4839981/symbols-not-found-for-architecture-i386#answer-7955906 – Mohammed Imran N Apr 23 '15 at 05:23
  • I went through that link. I didnt add a single piece of code to the App, its a bare bone Sample PhoneGap build. I didnt add anything to it.These are the only steps I did 1) cordova create xxxx com.xxxx xxxx 2) cd xxxx 3) cordova platform add ios ... and then changed the Build settings – joel Apr 23 '15 at 05:44
  • please check the settings in the Cordova lib too – Mohammed Imran N Apr 23 '15 at 08:25
  • Thank you very much, that saved me a whole lot of time in debugging !! – joel Apr 23 '15 at 23:37
  • why you've deleted ? – Ryan110 Jul 18 '18 at 04:49