问题
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