gpt4 book ai didi

flutter - 构建 Flutter 项目时显示的 firebase_core FlutterFire 插件错误找不到

转载 作者:行者123 更新时间:2023-12-04 03:35:56 36 4
gpt4 key购买 nike

构建flutter项目时出现以下错误:
*评估项目“:firebase_ml_vision”时出现问题。

Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec*


这是否意味着我必须安装一些额外的库?我只想在我的项目中使用 ML Vision。感谢您的任何帮助。
我的 pubspec.yaml 文件:
dependencies:
flutter:
sdk: flutter
get: ^3.24.0

firebase_ml_vision: ^0.11.0
image_picker: ^0.6.3+4
image_cropper: 1.0.2
build.gradle(应用程序):
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.grobonet"
minSdkVersion 16
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}

flutter {
source '../..'
}

build.gradle(项目)
buildscript {
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.google.gms:google-services:4.3.5'
}
}

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
}

最佳答案

添加 firebase_core 到您的项目。

关于flutter - 构建 Flutter 项目时显示的 firebase_core FlutterFire 插件错误找不到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66905093/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com