Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

【flutter】firebase登録時にsetting.gradeでのエラー

pubspec.yaml
dependencies:
  flutter:
    sdk: flutter
  provider: ^4.1.3
  firebase_core: ^0.4.5
  cloud_firestore: ^0.13.7

firebase_core,cloud_firestoreを登録した際に

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

のようなエラーが出力された。

この時、以下のような対応でエラーを解消した。

ステップ1 minsdkを16-21に変更

build.grade
 defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.trainingmaxapp"
        minSdkVersion 21 //16から21に変更
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

ステップ2 setting.gradeを追加する

setting.grade
include ':app'

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
}

これでエラーが解消される。

yukou29good0910
プログラミング初心者でアウトプットの場として 発信を行おうと思います。
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