LoginSignup
3
3

More than 3 years have passed since last update.

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

Last updated at Posted at 2020-12-12

次回

参考文献

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
3
3
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
3
3