XCODE 9 和 ionic ios 应用程序构建失败

Posted

技术标签:

【中文标题】XCODE 9 和 ionic ios 应用程序构建失败【英文标题】:XCODE 9 and ionic ios app build failed 【发布时间】:2018-07-31 14:38:53 【问题描述】:

在 ionic v1 中构建项目后。我将项目复制到 Mac Pc。 在 Mac Pc 中,我取消了 Podfile 的集成并删除了 Podfile,然后进行了 pod 安装。 之后我清理了项目。 当我尝试构建应用程序时,它显示链接器错误。

感谢任何帮助。

这是我的日志:

Ld /Users/inayath/Library/Developer/Xcode/DerivedData/Safences_Resident-bohfyzovmoapaxbnzlsayigtqxpl/Build/Intermediates.noindex/Safences\ Resident.build/Debug-iphoneos/Safences\ Resident.build/Objects-normal/arm64/Safences\ Resident normal arm64
cd /Users/inayath/Desktop/safencesResidentAppandroid/platforms/ios
export IPHONEOS_DEPLOYMENT_TARGET=9.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk -L/Users/inayath/Library/Developer/Xcode/DerivedData/Safences_Resident-bohfyzovmoapaxbnzlsayigtqxpl/Build/Products/Debug-iphoneos -L/Users/inayath/Library/Developer/Xcode/DerivedData/Safences_Resident-bohfyzovmoapaxbnzlsayigtqxpl/Build/Products/Debug-iphoneos/GoogleToolboxForMac -L/Users/inayath/Library/Developer/Xcode/DerivedData/Safences_Resident-bohfyzovmoapaxbnzlsayigtqxpl/Build/Products/Debug-iphoneos/Protobuf -L/Users/inayath/Library/Developer/Xcode/DerivedData/Safences_Resident-bohfyzovmoapaxbnzlsayigtqxpl/Build/Products/Debug-iphoneos/nanopb -F/Users/inayath/Library/Developer/Xcode/DerivedData/Safences_Resident-bohfyzovmoapaxbnzlsayigtqxpl/Build/Products/Debug-iphoneos -F/Users/inayath/Desktop/safencesResidentAppAndroid/platforms/ios/Pods/FirebaseAnalytics/Frameworks -F/Users/inayath/Desktop/safencesResidentAppAndroid/platforms/ios/Pods/FirebaseCore/Frameworks -F/Users/inayath/Desktop/safencesResidentAppAndroid/platforms/ios/Pods/FirebaseInstanceID/Frameworks -F/Users/inayath/Desktop/safencesResidentAppAndroid/platforms/ios/Pods/FirebaseMessaging/Frameworks -filelist /Users/inayath/Library/Developer/Xcode/DerivedData/Safences_Resident-bohfyzovmoapaxbnzlsayigtqxpl/Build/Intermediates.noindex/Safences\ Resident.build/Debug-iphoneos/Safences\ Resident.build/Objects-normal/arm64/Safences\ Resident.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=9.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/inayath/Library/Developer/Xcode/DerivedData/Safences_Resident-bohfyzovmoapaxbnzlsayigtqxpl/Build/Intermediates.noindex/Safences\ Resident.build/Debug-iphoneos/Safences\ Resident.build/Objects-normal/arm64/Safences\ Resident_lto.o -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -ObjC -ObjC -lGoogleToolboxForMac -lProtobuf -lc++ -lnanopb -lsqlite3 -lz -framework AddressBook -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseCoreDiagnostics -framework FirebaseInstanceID -framework FirebaseMessaging -framework FirebaseNanoPB -framework StoreKit -framework SystemConfiguration /Users/inayath/Library/Developer/Xcode/DerivedData/Safences_Resident-bohfyzovmoapaxbnzlsayigtqxpl/Build/Products/Debug-iphoneos/libCordova.a -weak_framework AddressBook -weak_framework AddressBookUI -weak_framework SystemConfiguration -framework CoreTelephony -weak_framework MessageUI -lPods-Safences\ Resident -Xlinker -dependency_info -Xlinker /Users/inayath/Library/Developer/Xcode/DerivedData/Safences_Resident-bohfyzovmoapaxbnzlsayigtqxpl/Build/Intermediates.noindex/Safences\ Resident.build/Debug-iphoneos/Safences\ Resident.build/Objects-normal/arm64/Safences\ Resident_dependency_info.dat -o /Users/inayath/Library/Developer/Xcode/DerivedData/Safences_Resident-bohfyzovmoapaxbnzlsayigtqxpl/Build/Intermediates.noindex/Safences\ Resident.build/Debug-iphoneos/Safences\ Resident.build/Objects-normal/arm64/Safences\ Resident

duplicate symbol _OBJC_CLASS_$_CDVLogger in:
    /Users/inayath/Library/Developer/Xcode/DerivedData/Safences_Resident-bohfyzovmoapaxbnzlsayigtqxpl/Build/Intermediates.noindex/Safences Resident.build/Debug-iphoneos/Safences Resident.build/Objects-normal/arm64/CDVLogger.o
    /Users/inayath/Library/Developer/Xcode/DerivedData/Safences_Resident-bohfyzovmoapaxbnzlsayigtqxpl/Build/Products/Debug-iphoneos/libCordova.a(CDVLogger.o)
duplicate symbol _OBJC_METACLASS_$_CDVLogger in:
    /Users/inayath/Library/Developer/Xcode/DerivedData/Safences_Resident-bohfyzovmoapaxbnzlsayigtqxpl/Build/Intermediates.noindex/Safences Resident.build/Debug-iphoneos/Safences Resident.build/Objects-normal/arm64/CDVLogger.o
    /Users/inayath/Library/Developer/Xcode/DerivedData/Safences_Resident-bohfyzovmoapaxbnzlsayigtqxpl/Build/Products/Debug-iphoneos/libCordova.a(CDVLogger.o)
ld: 2 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

【问题讨论】:

您是否尝试过删除 DerivedData 并重建? ***.com/a/39495772/3959708 是的,我已删除派生数据并重建。 在我存档产品之后,存档管理器窗口没有显示。 【参考方案1】:

来自here

如果您使用 ios 4.5 或更高版本,则需要删除插件“cordova-plugin-console”,因为 ios(平台)4.5 或更高版本默认添加此插件,因此您最终会出现重复错误。

ionic cordova plugin remove cordova-plugin-console

应该可以解决您的问题。

【讨论】:

以上是关于XCODE 9 和 ionic ios 应用程序构建失败的主要内容,如果未能解决你的问题,请参考以下文章

当 Ionic 3 应用程序在大于 9.3 的 ios 上运行时,Xcode 给出异常

在 Ionic 应用程序中加载 Cloudfront 图像时出错 - iOS 9

ionic cordova xcode 9构建开发团队和冲突的配置文件

Ionic pro 构建失败并出现错误 Xcode 9 未提供配置文件

android 6 和 IOS 9 中的 Ionic 问题

IONIC 4:“ionic cordova build ios”不显示使用 Xcode 10.1 构建失败或成功