一我碟、引入qr_code_scanner: ^0.7.0出現(xiàn)的問題
1.在flutter項(xiàng)目中的pubspec.yaml
引入qr_code_scanner: ^0.7.0
后,編譯項(xiàng)目姚建,fluter項(xiàng)目中出現(xiàn)的問題如下:
Launching lib/main.dart on 王淑寧的iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: N7XTE6J8P8
CocoaPods' output:
?
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `qr_code_scanner` from `.symlinks/plugins/qr_code_scanner/ios`
Resolving dependencies of `Podfile`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_0_2_a.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/5.0.11/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/5.0.11/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/5.0.10/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/5.0.9/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/5.0.8/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/5.0.7/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/5.0.6/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/5.0.5/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/5.0.3/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/5.0.2/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/5.0.1/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/5.0.0/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/4.0.0/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/3.1.0/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/3.0.0/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/2.1.0/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/2.0.3/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/2.0.2/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/2.0.1/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.9.1/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.9.0/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.8.11/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.8.10/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.8.9/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.8.8/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.8.7/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.8.6/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.8.5/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.8.4/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.8.3/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.8.1/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.8.0/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.7.1/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.7.0/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.6.1/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.6.0/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.5.0/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.4.0/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.3.2/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.3.0/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.2.0/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/1.1.18/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/0.1.8/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/0.1.7/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/0.1.6/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/0.1.5/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/0.1.4/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/0.1.3/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/0.1.2/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/0/2/a/MTBBarcodeScanner/0.1.1/MTBBarcodeScanner.podspec.json exists! Returning local because checking is only performed in repo update
Comparing resolved specification to the sandbox manifest
A Flutter
A MTBBarcodeScanner
A qr_code_scanner
Downloading dependencies
-> Installing Flutter (1.0.0)
-> Installing MTBBarcodeScanner (5.0.11)
> Copying MTBBarcodeScanner from `/Users/ningspeals/Library/Caches/CocoaPods/Pods/Release/MTBBarcodeScanner/5.0.11-f453b` to `Pods/MTBBarcodeScanner`
-> Installing qr_code_scanner (0.2.0)
- Running pre install hooks
[!] The following Swift pods cannot yet be integrated as static libraries:
The Swift pod `qr_code_scanner` depends upon `MTBBarcodeScanner`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/target_validator.rb:151:in `verify_swift_pods_have_module_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/target_validator.rb:40:in `validate!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:597:in `validate_targets'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:163:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:25:in `load'
/usr/local/bin/pod:25:in `<main>'
Error output from CocoaPods:
?
[!] Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Exception: Error running pod install
Exited (sigterm)
2.用Xcode打開IOS項(xiàng)目矫俺,編譯項(xiàng)目,出現(xiàn)的問題如圖1:
二掸冤、解決問題的方法
出現(xiàn)上述問題的原因
1.網(wǎng)絡(luò)原因厘托,下載GitHub項(xiàng)目需要翻墻,也就是需要VPN代理解決稿湿;
打開終端铅匹,輸入VPN代理命令(eg:export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890),cd到相應(yīng)的iOS目錄中缎罢,pod update 或 pod install伊群,具體操作步驟如圖2:
2.上圖中錯(cuò)誤有兩種原因?qū)е拢琗code中的Podfile文件中沒有引入use_frameworks!
或者沒有引入use_modular_headers!
打開Xcode中的Podfile文件策精,引入use_frameworks!
或use_modular_headers!
舰始,具體操作如圖3所示(在圖中圈出地方引入):
3.ios 鏈接庫(kù)的問題
操作完1.2后,在編譯iOS項(xiàng)目咽袜,出現(xiàn)ld: library not found for -lXXX丸卷,這里的處理方式是:在iOS項(xiàng)目中打開Build Settings -> Other Link Flags 打開以后,發(fā)現(xiàn)里面存在對(duì)應(yīng)的庫(kù)名稱询刹,前面還有一個(gè)前綴修飾: -lxxx谜嫉,把和flutter相關(guān)的全部都刪掉,然后commod + R凹联。