2017-07-12 46 views
0

我正在開發一個應用程序,它可以找到用戶位置周圍的興趣點。爲了獲得用戶的位置,我使用了工作得很好的location插件。
我想要實現的下一件事是打開默認映射應用程序來導航用戶到POI的按鈕。我使用url_launcher插件和android的geo:url方案以及適用於iOS的maps:方案進行了操作。
互相獨立,兩個插件按預期工作。一旦我在我的項目中插入了兩個插件,問題就開始了。使用默認設置的flutter create我得到以下錯誤:位置和url_launcher插件之間的衝突

Launching lib/main.dart on iPhone 6 in debug mode... 
Running pod install... 
CocoaPods' output: 
↳ 
    Preparing 

Analyzing dependencies 

Inspecting targets to integrate 
    Using `ARCHS` setting to build architectures of target `Pods-Runner`: (`arm64`) 

Finding Podfile changes 
    - Flutter 
    - location 
    - url_launcher 

Fetching external sources 
-> Fetching podspec for `Flutter` from `/Users/rainerwittmann/Flutter/flutter/bin/cache/artifacts/engine/ios` 
-> Fetching podspec for `location` from `/Users/rainerwittmann/.pub-cache/hosted/pub.dartlang.org/location-1.0.2/ios` 
-> Fetching podspec for `url_launcher` from `/Users/rainerwittmann/.pub-cache/hosted/pub.dartlang.org/url_launcher-0.4.2+1/ios` 

Resolving dependencies of `Podfile` 

Comparing resolved specification to the sandbox manifest 
    - Flutter 
    - location 
    - url_launcher 

Downloading dependencies 

-> Using Flutter (1.0.0) 

-> Using location (0.0.1) 

-> Using url_launcher (0.0.1) 
    - Running pre install hooks 
[!] Pods written in Swift can only be integrated as frameworks; add `use_frameworks!` to your Podfile or target to opt into using it. The Swift Pod being used is: location 

/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:448:in `block (2 levels) in verify_framework_usage' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:443:in `each' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:443:in `block in verify_framework_usage' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:440:in `each' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:440:in `verify_framework_usage' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/installer.rb:114:in `install!' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/command/install.rb:37:in `run' 
/Library/Ruby/Gems/2.0.0/gems/claide-1.0.1/lib/claide/command.rb:334:in `run' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/lib/cocoapods/command.rb:50:in `run' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.1.1/bin/pod:55:in `<top (required)>' 
/usr/local/bin/pod:23:in `load' 
/usr/local/bin/pod:23:in `<main>' 
Error running pod install 
Error launching application on iPhone 6. 

到目前爲止好。添加use_frameworks!我podfile,由錯誤信息提示導致另一個錯誤:

Launching lib/main.dart on iPhone 6 in debug mode... 
Running pod install... 
Running Xcode build... 
Failed to build iOS app 
Error output from Xcode build: 
↳ 
** CLEAN FAILED ** 


The following build commands failed: 
    Check dependencies 
(1 failure) 
** BUILD FAILED ** 


The following build commands failed: 
    Check dependencies 
(1 failure) 
Xcode's output: 
↳ 
Build settings from command line: 
    ARCHS = x86_64 
    BUILD_DIR = /Users/rainerwittmann/Flutter/zapfsuche/build/ios 
    ONLY_ACTIVE_ARCH = YES 
    SDKROOT = iphonesimulator10.3 

=== CLEAN TARGET location OF PROJECT Pods WITH CONFIGURATION Release === 

Check dependencies 
「Swift Language Version」 (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly. 

=== CLEAN TARGET url_launcher OF PROJECT Pods WITH CONFIGURATION Release === 
Check dependencies 

=== BUILD TARGET url_launcher OF PROJECT Pods WITH CONFIGURATION Release === 

Check dependencies 

=== BUILD TARGET location OF PROJECT Pods WITH CONFIGURATION Release === 

Check dependencies 
「Swift Language Version」 (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly. 

Could not build the application for the simulator. 
Error launching application on iPhone 6. 

不幸的是我不知道如何從這裏着手。有人可以幫我解決這個問題嗎?

注意
此問題僅在iOS上存在。這兩個插件都像在android上的魅力一樣工作。

回答

0

Swift插件需要use_frameworks!並且尚未得到完全支持。

我是currently working就可以了。謝謝你的耐心!

+0

所以我不能同時使用兩個插件?有沒有解決方法? –

+0

在bug中討論了一個解決方法('pre_install'鉤子)。如果您將這些標題手動複製到位,它就會起作用。我正在努力自動執行此操作。 –