私は、ユーザーの位置を中心に興味のあるポイントを見つけるアプリを開発しています。ユーザーの所在地を取得するには、私はlocationプラグインを使用します。これは非常にうまく動作します。
実装したいのは、ユーザーをPOIにナビゲートするためのデフォルトのマッピングアプリケーションを開くためのボタンです。私はurl_launcherプラグインとアンドロイドのgeo:urlスキームとiOSのmaps:schemを使って行った。
お互いに独立して、両方のプラグインが期待どおりに動作します。プロジェクトに両方のプラグインがあったら問題が始まりました。これまでのところは良い場所と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.
:私は次のエラーを取得するflutter create
のデフォルト設定を使用します。 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の魅力のように機能します。
私は両方のプラグインを同時に使用することはできませんか?回避策はありますか? –
このバグでは回避策があります( 'pre_install'フック)。あなたが手動でそれを動作させる場所にヘッダーをコピーする場合。私はこれを自動的に行うことに取り組んでいます。 –