构建iOS失败 - Cordova Ionic iOS

时间:2015-09-20 09:53:56

标签: ios cordova ionic

$ionic build ios

    CpResource PsarOnline/Resources/icons/icon-72@2x.png build/emulator/PsarOnline.app/icon-72@2x.png
        cd /Users/Roller/Working/Mobile/PsarOnline/platforms/ios
        export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/Roller/.rvm/gems/ruby-2.2.1/bin:/Users/Roller/.rvm/gems/ruby-2.2.1@global/bin:/Users/Roller/.rvm/rubies/ruby-2.2.1/bin:/usr/local/sbin:/Users/Roller/.node/bin:/usr/local/share/python:/usr/local/sbin:/usr/local/bin/python:/usr/local/bin:/sbin:/bin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/Roller/.rvm/bin"
        builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/PsarOnline/Resources/icons/icon-72@2x.png /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/emulator/PsarOnline.app

    ProcessInfoPlistFile build/emulator/PsarOnline.app/Info.plist PsarOnline/PsarOnline-Info.plist
        cd /Users/Roller/Working/Mobile/PsarOnline/platforms/ios
        export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/Roller/.rvm/gems/ruby-2.2.1/bin:/Users/Roller/.rvm/gems/ruby-2.2.1@global/bin:/Users/Roller/.rvm/rubies/ruby-2.2.1/bin:/usr/local/sbin:/Users/Roller/.node/bin:/usr/local/share/python:/usr/local/sbin:/usr/local/bin/python:/usr/local/bin:/sbin:/bin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/Roller/.rvm/bin"
        builtin-infoPlistUtility /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/PsarOnline/PsarOnline-Info.plist -genpkginfo /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/emulator/PsarOnline.app/PkgInfo -expandbuildsettings -format binary -platform iphonesimulator -additionalcontentfile /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/PsarOnline.build/Debug-iphonesimulator/PsarOnline.build/MainViewController-PartialInfo.plist -o /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/emulator/PsarOnline.app/Info.plist

    Ld build/emulator/PsarOnline.app/PsarOnline normal i386
        cd /Users/Roller/Working/Mobile/PsarOnline/platforms/ios
        export IPHONEOS_DEPLOYMENT_TARGET=6.0
        export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/Roller/.rvm/gems/ruby-2.2.1/bin:/Users/Roller/.rvm/gems/ruby-2.2.1@global/bin:/Users/Roller/.rvm/rubies/ruby-2.2.1/bin:/usr/local/sbin:/Users/Roller/.node/bin:/usr/local/share/python:/usr/local/sbin:/usr/local/bin/python:/usr/local/bin:/sbin:/bin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/Roller/.rvm/bin"
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -L/Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/emulator -L/Users/Roller/Working/Mobile/PsarOnline/platforms/ios/PsarOnline/Plugins/cordova-plugin-google-analytics -F/Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/emulator -filelist /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/PsarOnline.build/Debug-iphonesimulator/PsarOnline.build/Objects-normal/i386/PsarOnline.LinkFileList -mios-simulator-version-min=6.0 -Xlinker -objc_abi_version -Xlinker 2 -weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem -ObjC -fobjc-arc -fobjc-link-runtime -framework AssetsLibrary /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/emulator/libCordova.a -framework CoreGraphics -framework MobileCoreServices -lGoogleAnalyticsServices -framework SystemConfiguration -framework CoreData -lz -lsqlite3.0 -Xlinker -dependency_info -Xlinker /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/PsarOnline.build/Debug-iphonesimulator/PsarOnline.build/Objects-normal/i386/PsarOnline_dependency_info.dat -o /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/emulator/PsarOnline.app/PsarOnline
    duplicate symbol _OBJC_IVAR_$_IonicKeyboard._keyboardShowObserver in:
        /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/PsarOnline.build/Debug-iphonesimulator/PsarOnline.build/Objects-normal/i386/IonicKeyboard-A27CEE60F3321684.o
        /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/PsarOnline.build/Debug-iphonesimulator/PsarOnline.build/Objects-normal/i386/IonicKeyboard-CD8FF3CC2E72B79C.o
    duplicate symbol _OBJC_IVAR_$_IonicKeyboard._keyboardHideObserver in:
        /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/PsarOnline.build/Debug-iphonesimulator/PsarOnline.build/Objects-normal/i386/IonicKeyboard-A27CEE60F3321684.o
        /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/PsarOnline.build/Debug-iphonesimulator/PsarOnline.build/Objects-normal/i386/IonicKeyboard-CD8FF3CC2E72B79C.o
    duplicate symbol _OBJC_IVAR_$_IonicKeyboard._hideKeyboardAccessoryBar in:
        /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/PsarOnline.build/Debug-iphonesimulator/PsarOnline.build/Objects-normal/i386/IonicKeyboard-A27CEE60F3321684.o
        /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/PsarOnline.build/Debug-iphonesimulator/PsarOnline.build/Objects-normal/i386/IonicKeyboard-CD8FF3CC2E72B79C.o
    duplicate symbol _OBJC_IVAR_$_IonicKeyboard._disableScroll in:
        /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/PsarOnline.build/Debug-iphonesimulator/PsarOnline.build/Objects-normal/i386/IonicKeyboard-A27CEE60F3321684.o
        /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/PsarOnline.build/Debug-iphonesimulator/PsarOnline.build/Objects-normal/i386/IonicKeyboard-CD8FF3CC2E72B79C.o
    duplicate symbol _OBJC_CLASS_$_IonicKeyboard in:
        /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/PsarOnline.build/Debug-iphonesimulator/PsarOnline.build/Objects-normal/i386/IonicKeyboard-A27CEE60F3321684.o
        /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/PsarOnline.build/Debug-iphonesimulator/PsarOnline.build/Objects-normal/i386/IonicKeyboard-CD8FF3CC2E72B79C.o
    duplicate symbol _OBJC_METACLASS_$_IonicKeyboard in:
        /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/PsarOnline.build/Debug-iphonesimulator/PsarOnline.build/Objects-normal/i386/IonicKeyboard-A27CEE60F3321684.o
        /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/PsarOnline.build/Debug-iphonesimulator/PsarOnline.build/Objects-normal/i386/IonicKeyboard-CD8FF3CC2E72B79C.o
    ld: 6 duplicate symbols for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    ** BUILD FAILED **


    The following build commands failed:
        Ld build/emulator/PsarOnline.app/PsarOnline normal i386
    (1 failure)
    Error code 65 for command: xcodebuild with args: -xcconfig,/Users/Roller/Working/Mobile/PsarOnline/platforms/ios/cordova/build-debug.xcconfig,-project,PsarOnline.xcodeproj,ARCHS=i386,-target,PsarOnline,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/Roller/Working/Mobile/PsarOnline/platforms/ios/build/sharedpch
    ERROR building one of the platforms: Error: /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/cordova/build: Command failed with exit code 2
    You may not have the required environment or OS to build this project
    Error: /Users/Roller/Working/Mobile/PsarOnline/platforms/ios/cordova/build: Command failed with exit code 2
        at ChildProcess.whenDone (/Users/Roller/.node/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
        at ChildProcess.emit (events.js:110:17)
        at maybeClose (child_process.js:1015:16)
        at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

怎么了?

2 个答案:

答案 0 :(得分:6)

因为我以前从cordova安装的应用程序中有键盘重复插件。

解决方案:通过运行此命令删除键盘插件

$ cordova plugin remove ionic-plugin-keyboard

答案 1 :(得分:1)

我注意到你正在使用Ionic键盘cordova插件。确保您安装了import static foo.Template._; class Resource { String createURI(String id, String name) { return populateURITemplate(_.id(id).name(name)._()); } String populateURITemplate(Template t ){ return t.id+"="+t.name; } } @Builder(builderClassName = "_", builderMethodName = "_", buildMethodName = "_" ) class Template { static _ _ = _(); String id; String name; } 插件。我们有一个较旧的ionic-plugin-keyboard插件,所以如果你安装它们,你最终会得到重复的符号。您可以删除com.ionic.keyboard版本。