执行存档时引用的OBJC类

时间:2016-02-11 12:16:20

标签: ios objective-c xcode

当我在模拟器上运行应用程序时,一切正常。

现在我想归档应用程序以将其上传到testflight,并在归档时收到以下错误:

Ld /Users/user123/Library/Developer/Xcode/DerivedData/CityLife-eoovatnxpocygjcdijxojtryqted/Build/Intermediates/ArchiveIntermediates/Production/IntermediateBuildFilesPath/CityLife.build/Release-iphoneos/Production.build/Objects-normal/arm64/Production normal arm64
    cd /Users/user123/Documents/Development/Comp/citylife_user_phone_app_ios
    export IPHONEOS_DEPLOYMENT_TARGET=7.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/iPhoneOS9.2.sdk -L/Users/user123/Library/Developer/Xcode/DerivedData/CityLife-eoovatnxpocygjcdijxojtryqted/Build/Intermediates/ArchiveIntermediates/Production/BuildProductsPath/Release-iphoneos -L/Users/user123/Documents/Development/Comp/citylife_user_phone_app_ios/Pods/GoogleAnalytics/Libraries -F/Users/user123/Library/Developer/Xcode/DerivedData/CityLife-eoovatnxpocygjcdijxojtryqted/Build/Intermediates/ArchiveIntermediates/Production/BuildProductsPath/Release-iphoneos -FCityLife/Frameworks -F/Users/user123/Documents/Development/Comp/citylife_user_phone_app_ios -filelist /Users/user123/Library/Developer/Xcode/DerivedData/CityLife-eoovatnxpocygjcdijxojtryqted/Build/Intermediates/ArchiveIntermediates/Production/IntermediateBuildFilesPath/CityLife.build/Release-iphoneos/Production.build/Objects-normal/arm64/Production.LinkFileList -miphoneos-version-min=7.0 -dead_strip -ObjC -lAFNetworkActivityLogger -lAFNetworking -lAFOAuth2Manager -lBase64 -lFXBlurView -lGVPhotoBrowser -lGoogleAnalytics -lHexColors -lISO8601DateFormatter -lJSONModel -lMBProgressHUD -lMagicalRecord -lMasonry -lMixpanel -lNSDate+RelativeTime -lPDKeychainBindingsController -lQR-Code-Encoder-for-Objective-C -lREMenu -lReliant -lSVProgressHUD -lTSMessages -lTTTAttributedLabel -lTTTLocalizedPluralString -lUICKeyChainStore -lUIScrollView-InfiniteScroll -licucore -lsqlite3 -lz -framework Accelerate -framework CoreData -framework CoreGraphics -framework CoreTelephony -framework CoreText -framework Foundation -framework MobileCoreServices -framework QuartzCore -framework Security -framework SystemConfiguration -framework UIKit -fobjc-arc -fobjc-link-runtime -stdlib=libc++ -framework CoreData -lz -framework SystemConfiguration -framework CoreTelephony -framework AVFoundation -framework CoreMedia -framework QuartzCore -framework CoreVideo -framework MobileCoreServices -framework KBCPaymentKit -framework AdSupport -framework AddressBookUI -framework Crashlytics -framework AddressBook -liconv -framework MessageUI -framework MapKit -lsqlite3 -framework CoreLocation -framework Accounts -framework Social -framework UIKit -framework Foundation -framework CoreGraphics -lPods -Xlinker -dependency_info -Xlinker /Users/user123/Library/Developer/Xcode/DerivedData/CityLife-eoovatnxpocygjcdijxojtryqted/Build/Intermediates/ArchiveIntermediates/Production/IntermediateBuildFilesPath/CityLife.build/Release-iphoneos/Production.build/Objects-normal/arm64/Production_dependency_info.dat -o /Users/user123/Library/Developer/Xcode/DerivedData/CityLife-eoovatnxpocygjcdijxojtryqted/Build/Intermediates/ArchiveIntermediates/Production/IntermediateBuildFilesPath/CityLife.build/Release-iphoneos/Production.build/Objects-normal/arm64/Production

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_CommunityRemoteService", referenced from:
      objc-class-ref in CommunityDetailsViewController.o
      objc-class-ref in CommunityRewardsTableViewController.o
      objc-class-ref in WishlistTableViewController.o
      objc-class-ref in CommunityOverviewTableViewController.o
      objc-class-ref in CommunityRewardDetailTableViewController.o
      objc-class-ref in ProfileCommunityOverViewTableViewController.o
      objc-class-ref in CommunityDealsTableViewController.o
      ...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我尝试过在Pods目标上添加$(继承)标志,但没有任何帮助。

有人知道什么是错的?

1 个答案:

答案 0 :(得分:0)

发现问题。因为我用AppCode创建了文件,所以文件只在测试目标中而不在生产目标中。

我已经通过xCode将它们添加到编译源中,现在它可以正常工作。