2
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

posted at

updated at

Organization

【Flutter】遭遇したエラー&&解決策まとめ

次回

参考文献

Podライブラリの警告

◆ エラー内容

The iOS Simulator deployment target ‘IPHONEOS_DEPLOYMENT_TARGET’ is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99.

◆ 解決策

Podfile
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
    end
  end
end
$ pod update

GoogleDataTransportエラー

◆ エラー内容

error: umbrella header for module 'GoogleDataTransport' does not include header 'GDTCORDataFuture.h'

◆ 解決策

$ rm -rf Pods
$ flutter clean
$ flutter run //pod installが自動実行される

「firebase_core_web not found」エラー

◆ エラー内容

Plugin project :firebase_core_web not found. 
Please update settings.gradle.

◆ 解決策

setting.gradle
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()

def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
    pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}

plugins.each { name, path ->
    def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
    include ":$name"
    project(":$name").projectDir = pluginDirectory
}

「Firebase.initializeApp」エラー

◆ エラー内容

No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()

◆ 解決策

Widget _buildBody(BuildContext context) {
    Firebase.initializeApp(); // new
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
2
Help us understand the problem. What are the problem?