首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >位置与url_launcher插件的冲突

位置与url_launcher插件的冲突
EN

Stack Overflow用户
提问于 2017-07-12 06:14:27
回答 2查看 957关注 0票数 0

我正在开发一个应用程序,它可以在用户的位置周围找到感兴趣的点。为了获得用户的位置,我使用了位置插件,它非常好地工作。

接下来我要实现的是打开默认映射应用程序的按钮,以将用户导航到POI。我使用了启动器插件和iOS的geo: url方案和iOS地图。

两个插件相互独立,工作正常。在我的项目中有了这两个插件之后,问题就开始了。使用flutter create的默认设置,我得到以下错误:

代码语言:javascript
复制
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中,正如错误消息所建议的那样,导致了另一个错误:

代码语言:javascript
复制
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.

不幸的是,我不知道如何从这里开始。有人能帮我解决这个问题吗?

Note

这个问题只存在于iOS上。这两个插件在android上都很有魅力。

EN

回答 2

Stack Overflow用户

发布于 2017-07-12 06:31:36

快速插件需要use_frameworks!但这还没有得到充分的支持。

我是目前正在工作。谢谢你的耐心!

票数 0
EN

Stack Overflow用户

发布于 2019-04-07 18:52:20

编辑Podfile

在“目标'Runner‘do”行号~35后添加/取消注释

代码语言:javascript
复制
use_frameworks!

然后在行号~67后面添加这一行

代码语言:javascript
复制
config.build_settings['SWIFT_VERSION'] = '4.0'

示例:

代码语言:javascript
复制
target 'Runner' do
  ** use_frameworks!  **
........ ......

post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['ENABLE_BITCODE'] = 'NO'
          ** config.build_settings['SWIFT_VERSION'] = '4.0' **
        end
      end
    end

删除您的Podfile.lock并尝试。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45049752

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档