Cordova linker error when Build Active Architecture Only is No “file was built for archive which is not the architecture being linked (i386)”

妖精的绣舞 提交于 2019-12-23 06:03:28

问题


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

Thanks in advance

回答1:


Can you please confirm your setting looks like this ?



来源:https://stackoverflow.com/questions/29813051/cordova-linker-error-when-build-active-architecture-only-is-no-file-was-built-f

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!