我最近升级到了Ionic CLI。当我尝试构建我现有的离子v1项目时,构建失败,通过查看日志,我不知道可能导致问题的原因。我在升级时遵循了http://blog.ionic.io/announcing-ionic-cli-v3/中列出的所有步骤。
以下是我运行离子信息时的内容:
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.13.1
ionic (Ionic CLI) : 3.13.2
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
Cordova Platforms : android 6.1.2 ios 4.5.2
Ionic Framework : ionic1 1.3.2
System:
ios-deploy : 1.9.1
ios-sim : 6.1.2
Node : v6.9.5
npm : 5.4.2
OS : macOS Sierra
Xcode : Xcode 9.0.1 Build version 9A1004
Misc:
backend : pro
以下是我在尝试运行构建时获得的内容:
? What platform would you like to build (android, ios): ios
[WARN] Not performing Ionic build for project type: ionic1.
> cordova build ios
✖ Running command - failed!
[ERROR] An error occurred while running cordova build ios (exit code 1):
(truncated) ... build/Objects-normal/x86_64/IonicKeyboard.d --serialize-diagnostics
/Users/jotiz/Library/Developer/Xcode/DerivedData/zippy-ciupgzhzpacjwohbhancqlvpjrgk/Build/Intermediates.noindex/zippy.build/Debug-iphonesimulator/zippy.build/Objects-normal/x86_64/IonicKeyboard.dia
-c
/Users/jotiz/Documents/Projects/zippy/platforms/ios/zippy/Plugins/ionic-plugin-keyboard/IonicKeyboard.m
-o
/Users/jotiz/Library/Developer/Xcode/DerivedData/zippy-ciupgzhzpacjwohbhancqlvpjrgk/Build/Intermediates.noindex/zippy.build/Debug-iphonesimulator/zippy.build/Objects-normal/x86_64/IonicKeyboard.o
Ld build/emulator/zippy.app/zippy normal x86_64
cd /Users/jotiz/Documents/Projects/zippy/platforms/ios
export IPHONEOS_DEPLOYMENT_TARGET=9.0
export
PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/jotiz/Documents/Projects/zippy/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/mysql/bin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk
-L/Users/jotiz/Documents/Projects/zippy/platforms/ios/build/emulator
-L/Users/jotiz/Documents/Projects/zippy/platforms/ios/zippy/Plugins/cordova-plugin-extension
-F/Users/jotiz/Documents/Projects/zippy/platforms/ios/build/emulator
-Fzippy/Plugins/cordova-admobsdk -Fzippy/Plugins/cordova-facebook-audnet-sdk -filelist
/Users/jotiz/Library/Developer/Xcode/DerivedData/zippy-ciupgzhzpacjwohbhancqlvpjrgk/Build/Intermediates.noindex/zippy.build/Debug-iphonesimulator/zippy.build/Objects-normal/x86_64/zippy.LinkFileList
-Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=9.0 -dead_strip -Xlinker
-object_path_lto -Xlinker
/Users/jotiz/Library/Developer/Xcode/DerivedData/zippy-ciupgzhzpacjwohbhancqlvpjrgk/Build/Intermediates.noindex/zippy.build/Debug-iphonesimulator/zippy.build/Objects-normal/x86_64/zippy_lto.o
-Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -Xlinker
-sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker
/Users/jotiz/Library/Developer/Xcode/DerivedData/zippy-ciupgzhzpacjwohbhancqlvpjrgk/Build/Intermediates.noindex/zippy.build/Debug-iphonesimulator/zippy.build/zippy.app.xcent
/Users/jotiz/Documents/Projects/zippy/platforms/ios/build/emulator/libCordova.a -framework
GoogleMobileAds -framework AdSupport -framework StoreKit -framework CoreMotion -framework CoreImage -framework
QuartzCore -framework OpenGLES -framework Security -lc++ -lxml2 -framework FBAudienceNetwork -weak_framework
ImageIO -framework CoreLocation -framework AVFoundation -weak_framework AudioToolbox -lCordovaGenericAd
-framework CFNetwork -weak_framework SystemConfiguration -framework CoreTelephony -Xlinker -dependency_info
-Xlinker
/Users/jotiz/Library/Developer/Xcode/DerivedData/zippy-ciupgzhzpacjwohbhancqlvpjrgk/Build/Intermediates.noindex/zippy.build/Debug-iphonesimulator/zippy.build/Objects-normal/x86_64/zippy_dependency_info.dat
-o /Users/jotiz/Documents/Projects/zippy/platforms/ios/build/emulator/zippy.app/zippy
duplicate symbol _OBJC_CLASS_$_CDVLogger in:
/Users/jotiz/Library/Developer/Xcode/DerivedData/zippy-ciupgzhzpacjwohbhancqlvpjrgk/Build/Intermediates.noindex/zippy.build/Debug-iphonesimulator/zippy.build/Objects-normal/x86_64/CDVLogger.o
/Users/jotiz/Documents/Projects/zippy/platforms/ios/build/emulator/libCordova.a(CDVLogger.o)
duplicate symbol _OBJC_METACLASS_$_CDVLogger in:
/Users/jotiz/Library/Developer/Xcode/DerivedData/zippy-ciupgzhzpacjwohbhancqlvpjrgk/Build/Intermediates.noindex/zippy.build/Debug-iphonesimulator/zippy.build/Objects-normal/x86_64/CDVLogger.o
/Users/jotiz/Documents/Projects/zippy/platforms/ios/build/emulator/libCordova.a(CDVLogger.o)
ld: 2 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/emulator/zippy.app/zippy normal x86_64
(1 failure)
Error: Error code 65 for command: xcodebuild with args:
-xcconfig,/Users/jotiz/Documents/Projects/zippy/platforms/ios/cordova/build-debug.xcconfig,-workspace,zippy.xcworkspace,-scheme,zippy,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS
Simulator,name=iPhone
X,build,CONFIGURATION_BUILD_DIR=/Users/jotiz/Documents/Projects/zippy/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/jotiz/Documents/Projects/zippy/platforms/ios/build/sharedpch
答案 0 :(得分:6)
我也有同样的问题。我认为离子(离子CLI)存在问题:3.13.2。 然后我删除了当前版本并重新安装旧版本,然后它适用于旧版本离子。
sudo npm uninstall -g ionic
sudo npm install -g ionic@2.2.0
或
sudo npm uninstall -g ionic
sudo npm install -g ionic@2.2.3
或
sudo npm uninstall -g ionic
sudo npm install -g ionic@2.3.0