4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Flutter】iOS実機にてReleaseビルドが通らない場合の対処法

Posted at

開発環境

OS: MacOS
Flutter: 3.0.4
Flutter Channel: Stable
Dart: 2.17.5
Android Studio: Artic Fox | 2020.3.1 Patch4

エラーメッセージ

Automatically signing iOS for device deployment using specified development team in Xcode project: XXXXXXX
Running pod install...
Running Xcode build...
Xcode build done.                                            8.3s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    Writing result bundle at path:
    	/var/folders/xz/8ytcyfm94hj21ggqskb0fgsc0000gn/T/flutter_tools.XxfdYA/flutter_ios_build_temp_dirhG8RAE/temporary_xcresult_bundle

    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in parallel
    /Users/ユーザ名/AndroidStudioProjects/アプリ名/ios/Flutter/Release.xcconfig:3:1: error: could not find included file 'Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig' in search paths
    /Users/ユーザ名/AndroidStudioProjects/アプリ名/ios/Flutter/Release.xcconfig:3:1: error: could not find included file 'Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig' in search paths
    /Users/ユーザ名/AndroidStudioProjects/アプリ名/ios/Flutter/Release.xcconfig:3:1: error: could not find included file 'Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig' in search paths

    Result bundle written to path:
    	/var/folders/xz/8ytcyfm94hj21ggqskb0fgsc0000gn/T/flutter_tools.XxfdYA/flutter_ios_build_temp_dirhG8RAE/temporary_xcresult_bundle


Could not build the precompiled application for the device.
Error (Xcode): could not find included file 'Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig' in search paths
/Users/ユーザ名/AndroidStudioProjects/アプリ名/ios/Flutter/Release.xcconfig:2:0


Error running application on 実機名.

原因

includeに指定したファイルのパスが誤っていることが原因です。
下記エラーメッセージではRelease.xcconfigにてincludeに指定しているPods-Runner.profile.xcconfigが見つからないよ、と言っています。

Error (Xcode): could not find included file 'Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig' in search paths
/Users/ユーザ名/AndroidStudioProjects/アプリ名/ios/Flutter/Release.xcconfig:2:0

実際にファイルの階層を確認してみると頭のPods/が抜けていることがわかります。
※ Release.xcconfigから見た相対パス
スクリーンショット 2022-07-26 17.00.55.png

対処法

ios/Flutter/Release.xcconfigにてincludeに指定しているファイルのパスを修正します。
Pods-Runner.profile.xcconfigの先頭にPods/を追加します。

修正前
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
// ↓修正対象
#include "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"
修正後
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
// ↓先頭にPods/を追加
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"
4
0
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
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?