2013-12-18 39 views
1

當Zbar條碼掃描器插件實施時,我的PhoneGap 3.2.0應用程序在Mac上編譯時出現問題。這將在Xcode編譯,如果我部署到設備,而是一個模擬裝置,它給人的錯誤:Zbar Barcode Scanner與PhoneGap編譯錯誤

Ld DerivedData/MYAPP/Build/Products/Debug-iphonesimulator/MYAPP.app/MYAPP normal i386 cd /Users/Cordova/MyApp/platforms/ios setenv IPHONEOS_DEPLOYMENT_TARGET 5.0 setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/Cordova/MyApp/platforms/ios/DerivedData/MYAPP/Build/Products/Debug-iphonesimulator -L/Users/Cordova/MyApp/platforms/ios/ZBarSDK -L/Users/Cordova/MyApp/platforms/ios/MYAPP/Plugins/com.manateeworks.barcodescanner/MWBarcodeScanner -F/Users/Cordova/MyApp/platforms/ios/DerivedData/MYAPP/Build/Products/Debug-iphonesimulator -filelist /Users/Cordova/MyApp/platforms/ios/DerivedData/MYAPP/Build/Intermediates/MYAPP.build/Debug-iphonesimulator/MYAPP.build/Objects-normal/i386/MYAPP.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem -force_load /Users/Cordova/MyApp/platforms/ios/DerivedData/MYAPP/Build/Products/Debug-iphonesimulator/libCordova.a -ObjC -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=5.0 -framework AssetsLibrary -framework CoreGraphics -framework MobileCoreServices -framework CoreLocation -weak_framework ImageIO -framework CoreMotion -weak_framework AudioToolbox -weak_framework SystemConfiguration -framework Foundation -framework UIKit -framework AVFoundation -framework CoreMedia -framework CoreVideo -framework QuartzCore -liconv -lzbar -Xlinker -dependency_info -Xlinker /Users/Cordova/MyApp/platforms/ios/DerivedData/MYAPP/Build/Intermediates/MYAPP.build/Debug-iphonesimulator/MYAPP.build/Objects-normal/i386/MYAPP_dependency_info.dat -o /Users/Cordova/MyApp/platforms/ios/DerivedData/MYAPP/Build/Products/Debug-iphonesimulator/MYAPP.app/MYAPP

ld: warning: ignoring file /Users/Cordova/MyApp/platforms/ios/ZBarSDK/libzbar.a, missing required architecture i386 in file /Users/Cordova/MyApp/platforms/ios/ZBarSDK/libzbar.a (3 slices) Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ZBarReaderViewController", referenced from: objc-class-ref in ZbarcodeScanner.o "_ZBarReaderControllerResults", referenced from: -[ZbarcodeScanner imagePickerController:didFinishPickingMediaWithInfo:] in ZbarcodeScanner.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

雖然我真的不想要或需要的模擬設備;問題是,從終端,當我運行命令:

$ cordova build ios

它拋出了錯誤:

Error: An error occurred while building the ios project.

** BUILD FAILED **

The following build commands failed:

Ld build/emulator/MyApp.app/MyApp normal i386 

(1 failure)

如果我嘗試在自己的鍵入錯誤顯示的命令,它告訴我:

ld: file not found: build/emulator/MyApp.app/MyApp

這是真的。它不存在。我認爲別的東西在這之前就失敗了,並且阻止了它的創建。

如果我一起刪除Zbar,它一切正常。

我之前創建的應用程序的版本已經回到了PhoneGap v2.5.0的版本,並且沒有使用命令行界面來創建版本。我手動把它放在一起,所以它沒有給我這個問題。

我已經在Build Settings/Build Phases部分中嘗試了很多東西。我已經在這裏工作了兩個星期了,而且似乎我所做的每件事都會導致新的錯誤信息。請幫忙!

+1

LD命令嘗試將庫文件鏈接到輸出DerivedData/MYAPP/Build/Products/Debug-iphonesimulator/MYAPP.app/MYAPP 它似乎失敗了,因爲ZBar sdk沒有編譯或者沒有i386體系結構的右側標誌,因此連接失敗並且目錄不會被創建。 至少這是我從命令/輸出中猜到的,我實際上無法親自嘗試。 –

回答

0

我解決了這個問題!我將ZBar的版本降級到了前面的版本,並且它立即工作。我在我的項目中有一些版本,顯然有ios7修復。不知道問題的確切原因到底是什麼。