1
0

More than 1 year has passed since last update.

FlutterでiOSシュミレーターが作動しない問題

Last updated at Posted at 2022-07-05

久々に修正しようとflutterを立ち上げてiosシュミレーターを開こうとしたら、デバッグコンソールに下記エラーが出て立ち上がらなくなっていました。

Running "flutter pub get" in hogehoge...
The current Dart SDK version is 2.17.0-182.0.dev.

Because flutter_hooks 0.18.5+1 requires SDK version >=2.17.0 <3.0.0 and no versions of flutter_hooks match >0.18.5+1 <0.19.0, flutter_hooks ^0.18.5+1 is forbidden.
So, because hoge depends on flutter_hooks ^0.18.5+1, version solving failed.
pub get failed (1; So, because hoge depends on flutter_hooks ^0.18.5+1, version solving failed.)
Exited (1)

動かしているシュミレーターなどを一度止めてflutterを安定バージョンにしてから、

flutter channel stable

アップグレードしたら。。。

flutter upgrade

下記エラーが出てきたので、

Running "flutter pub get" in hogehoge...
This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
The plugin `audioplayers_android` requires your app to be migrated to the Android embedding v2. Follow the steps on https://flutter.dev/go/android-project-migration and re-run this command.
Exited (1)

androidフォルダ削除後に

flutter run

してみると、

Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
To update the CocoaPods specs, run:
  pod repo update



Error running pod install
Error launching application on iPhone SE (3rd generation).
cd ios
pod repo update

Updating spec repo 'trunk'と出た後、再度ディレクトリを戻して

flutter run

するが、スクリーンショット 2022-07-05 9.49.08.png
ローディングが永遠と終わらなかったので、一旦解除してiosフォルダから直接

cd ios
pod install

を試みる。。。
スクリーンショット 2022-07-05 9.54.43.png
ここで時間がかかっているようなので正常にはインストールできているようです。

終了したのでF5で実行してみたが、新しいエラーが。。。

Umbrella header for module 'GoogleUtilities' does not include header 'GULSwizzler.h'

すかさず下記コマンドを試みる。(DerivedDataのキャッシュをクリア)

rm -rf ~/Library/Developer/Xcode/DerivedData/
cd ios
pod deintegrate
pod update

エラー内容変わらず。。。

Error launching application on iPhone

このエラーも出ていたので、そちらから対応してみるiosフォルダにいる状態で

pod install --repo-update 
flutter clean
flutter pub get
flutter pub upgrade
rm -Rf ios/Podfile
rm -Rf ios/Podfile.lock

Podfile, Podfile.lock, Podsフォルダを削除してから

flutter clean

して実行しても変わらず。

rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
rm ios/Podfile

もう一度削除して、

flutter upgrade
cd ios
pod init     // <---errorが出なかったらupdateへ
pod update
flutter clean

してから

flutter pub get
flutter run

したらいけましたヽ(´o`; いったいなにが問題だったのか。。。
iosフォルダ内のproject.pbxproj Podfile Podfile.lockpubspec.lockの書き換えが必要だったようですが、それでも解決できない場合は実装に問題があるのかと。

1
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
1
0