首页 > 解决方案 > 当我尝试将firebase集成到在android中运行的flutter 1.9.1应用程序中并且我得到错误sqfile

问题描述

更新到 android 1.9.1 修补程序 6 后,我试图在 android 9 上运行我的应用程序,并且在我运行应用程序时继续出现相同的错误

我将所有依赖项和插件更新到最新版本

这是我所有的配置

这是我的项目 yml 依赖项

environment:
  sdk: ">=2.4.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  flutter_crashlytics: ^1.0.0
  rxdart: 0.22.2
  kiwi: ^0.2.0
  http: ^0.12.0+2
  shared_preferences: ^0.5.3+4
  image_picker: ^0.6.1+4
  photo_view: ^0.5.0
  cached_network_image: ^1.1.1
  smooth_star_rating: ^1.0.2
  carousel_slider: ^1.3.1
  dio: ^2.1.0
  url_launcher: ^5.1.3
  webview_flutter: ^0.3.5+3
  flare_flutter: ^1.7.1
  geolocator: ^5.1.3
  path_provider: ^1.4.4
  sqflite: ^1.1.7+2

gradle 版本 6.0.1 android /build.gradle

    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.2.0'

    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

android/app/build.gradle

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services' 

并让我说这个错误,我有最新版本的 sqflite

[        ] > Task :app:processDebugGoogleServices FAILED
[        ] Parsing json file: ***\code\mobile-app\android\app\google-services.json
[   +1 ms]          *********************************************************
[        ] WARNING: This version of sqflite will break your Android build if it or its dependencies aren't compatible with AndroidX.
[        ]          See ..... for more information on the problem and how to fix it.
[        ]          This warning prints for all Android build failures. The real root cause of the error may be unrelated.
[        ]          *********************************************************
[        ] 42 actionable tasks: 4 executed, 38 up-to-date

标签: flutterflutter-dependencies

解决方案


实际上错误是gradle文件和android清单不匹配


推荐阅读