LoginSignup
5
1

More than 3 years have passed since last update.

Flutter で pod install が失敗する [!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries

Last updated at Posted at 2021-03-29

出力されているエラー

$ pod install
Analyzing dependencies
cloud_firestore: Using Firebase SDK version '6.33.0' defined in 'firebase_core'
firebase_analytics: Using Firebase SDK version '6.33.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '6.33.0' defined in 'firebase_core'
firebase_messaging: Using Firebase SDK version '6.33.0' defined in 'firebase_core'
firebase_remote_config: Using Firebase SDK version '6.33.0' defined in 'firebase_core'
Downloading dependencies
[!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (/path-to/ios/Flutter/Flutter.framework)

解決方法

今後実行するスクリプトは全てiosディレクトリ内で実行してください

$ cd ios

まずは更地に戻します

$ flutter clean
$ rm -rf Flutter/Flutter.framework Pods Podfile.lock

Podfileに追記します

# NOTE: For detail 👉 https://github.com/CocoaPods/CocoaPods/issues/3289
pre_install do |installer|
  Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end

スクリーンショット 2021-03-29 18.29.34.png

パッケージを入れ直してビルドします

$ flutter pub get
$ flutter build ios
$ pod install

次のようなログが出ると成功です

$ pod install
Analyzing dependencies
cloud_firestore: Using Firebase SDK version '6.33.0' defined in 'firebase_core'
firebase_analytics: Using Firebase SDK version '6.33.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '6.33.0' defined in 'firebase_core'
firebase_messaging: Using Firebase SDK version '6.33.0' defined in 'firebase_core'
firebase_remote_config: Using Firebase SDK version '6.33.0' defined in 'firebase_core'
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 17 dependencies from the Podfile and 39 total pods installed.

間違った解決方法

use_frameworks! をコメントアウトする

スクリーンショット 2021-03-29 18.32.54.png
普通にエラーになります

[!] The 'Pods-Runner' target has transitive dependencies that include static frameworks: (FirebaseCore, FirebaseDatabase, FirebaseMessaging, FirebaseDatabase, FirebaseCore, FirebaseMessaging, FirebaseMessaging, FirebaseCore, and FirebaseDatabase)

cf. https://github.com/flutter/flutter/issues/20045#issuecomment-409492211

5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1