質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Flutter

Flutterは、iOSとAndroidのアプリを同じコードで開発するためのフレームワークです。オープンソースで開発言語はDart。双方のプラットフォームにおける高度な実行パフォーマンスと開発効率を提供することを目的としています。

iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

ビルド

ソースコードを単体で実行可能なソフトウェアへ変換する過程をビルド(build)と呼びます

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Q&A

解決済

2回答

6726閲覧

[Flutter]M1 Macでビルドができなくなってしまった

Nave

総合スコア4

Flutter

Flutterは、iOSとAndroidのアプリを同じコードで開発するためのフレームワークです。オープンソースで開発言語はDart。双方のプラットフォームにおける高度な実行パフォーマンスと開発効率を提供することを目的としています。

iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

ビルド

ソースコードを単体で実行可能なソフトウェアへ変換する過程をビルド(build)と呼びます

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

0グッド

0クリップ

投稿2021/02/19 00:22

編集2021/02/19 00:23

M1 MacでiOS端末のエミュレータを起動すると

[verbose-2:profiler_metrics_ios.mm(184)] error retrieving thread information: (ipc/send) invalid destination port

のメッセージが出てくるため検索してみると、下記のコマンドを打ち込むと良いと書いてあったので試しました。

flutter channel beta

flutter upgrade
flutter clean
flutter run

をすると、設定がおかしくなってしまったのか、下記のエラーが出てiOSエミュレータが動きません。
これは一体何をすれば良いのでしょうか??

Launching lib/main.dart on iPhone 12 Pro Max in debug mode... Upgrading contents.xcworkspacedata Running Xcode build... Xcode build done. 12.1s Failed to build iOS app Error output from Xcode build: ↳ objc[12091]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x2083cc188) and ?? (0x113f182b8). One of the two will be used. Which one is undefined. objc[12091]: Class AMSupportURLSession is implemented in both ?? (0x2083cc1d8) and ?? (0x113f18308). One of the two will be used. Which one is undefined. ** BUILD FAILED ** Xcode's output: ↳ ../../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.19.1/lib/src/picture_provider.dart:52:59: Error: No named parameter with the name 'nullOk'. context != null ? Localizations.localeOf(context, nullOk: true) : null, ^^^^^^ ../../../flutter/packages/flutter/lib/src/widgets/localizations.dart:413:17: Context: Found this candidate, but the arguments don't match. static Locale localeOf(BuildContext context) { ^^^^^^^^ Command PhaseScriptExecution failed with a nonzero exit code note: Using new build system note: Building targets in parallel note: Planning build note: Constructing build description Could not build the application for the simulator. Error launching application on iPhone 12 Pro Max.

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答2

0

ベストアンサー

[verbose-2:profiler_metrics_ios.mm(184)] error retrieving thread information: (ipc/send) invalid destination port

公式のissuesを確認しました。
この警告文についてはまだ原因の特定はされていないようです。
上記の警告文についてのissues

../../../flutter/packages/flutter/lib/src/widgets/localizations.dart:413:17: Context: Found this candidate, but the arguments don't match.
static Locale localeOf(BuildContext context) {

flutterのgithubを確認しましたが、betaブランチで26日前にLocalizations.localeOfの引数nullOkを削除するコミットがありました。対象のコミット
打ちこんだ「flutter channel beta」でこのコミットが入っているライブラリに更新されたと予想します。

チャンネルをmasterに戻す、つまり

flutter

1flutter channel master 2flutter upgrade 3flutter clean 4flutter run

でこのエラーは消えると思います。
余談ですが、このコミットはmasterにも結合されていたので今後のVerで引数nullOkは削除される可能性が高いです。コミットの内容を見ていただけるとわかると思いますが、Nullを許容しないように変更しているみたいなのであらかじめ対応しておいて損は無いと思います。

投稿2021/02/20 18:07

kureta

総合スコア18

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

Nave

2021/02/22 00:14

回答でいただいた方法で試したのですが、flutter runを実行したタイミングで下記のようなエラーが出てしまいます。。。 SVG画像を使うためのパッケージがかち合ってるみたいなので、それ消すしかないのでしょうか???? (https://pub.dev/packages/flutter_svg) ``` Running "flutter pub get" in hoge-App... 2,481ms Launching lib/main.dart on iPhone 12 Pro Max in debug mode... Running Xcode build... Xcode build done. 13.1s Failed to build iOS app Error output from Xcode build: ↳ objc[41048]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x2083cc188) and ?? (0x11fda42b8). One of the two will be used. Which one is undefined. objc[41048]: Class AMSupportURLSession is implemented in both ?? (0x2083cc1d8) and ?? (0x11fda4308). One of the two will be used. Which one is undefined. ** BUILD FAILED ** Xcode's output: ↳ ../../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.19.2+1/lib/src/picture_provider.dart:57:59: Error: No named parameter with the name 'nullOk'. context != null ? Localizations.localeOf(context, nullOk: true) : null, ^^^^^^ ../../../flutter/packages/flutter/lib/src/widgets/localizations.dart:413:17: Context: Found this candidate, but the arguments don't match. static Locale localeOf(BuildContext context) { ^^^^^^^^ Command PhaseScriptExecution failed with a nonzero exit code note: Using new build system note: Building targets in parallel note: Planning build note: Constructing build description Could not build the application for the simulator. Error launching application on iPhone 12 Pro Max. ```
kureta

2021/02/22 01:06

すみません、確かによく見たらflutter_svgライブラリでエラー起きてますね。 puv.devを確認しましたがflutter_svgは[UNIDENTIFIED]になっているので別のライブラリに差し替えたをおすすめします。
guest

0

もしnull-safety非対応のライブラリを使われている場合は、flutter2では動かないので、一時的にflutter downgradeをして戻してから"Error retrieving thread information"を無視してビルドするようなコマンドを打てば一旦は大丈夫かと思います。

具体的な手順は以下です。
flutter upgradeでpubspec.yamlが自動更新されてると思うので、前に使っていたバージョンにそれぞれ戻してもらって、

flutter downgrade flutter clean flutter run | grep -v "Error retrieving thread information"

grep -vというのは一致するものを弾くというコマンドなので、"Error retrieving thread information"に一致するエラーは表示されないようになります。
これで大量のエラーがなくなるので問題なくビルドできます。

もちろんnull-safety対応済みならば最新のバージョンでリビルドするのが一番良いですが、ご参考までに。

投稿2021/03/28 08:26

YuikoIto

総合スコア11

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問