gpt4 book ai didi

Firebase SDK 安装问题 Flutter

转载 作者:行者123 更新时间:2023-12-03 05:23:12 26 4
gpt4 key购买 nike

我正在按照 Flutter 教程安装 Firebase SDK,而 VSCode 的成绩似乎有问题。它告诉我“您的应用正在使用不受支持的 Gradle 项目”。我已经查看了这个网站上的所有相关问题,并尽我所能,但这个错误似乎并没有消失。以下是我认为相关的所有内容:
我的顶级 gradle.build 文件:

    buildscript {
repositories {
google()
jcenter()
}

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

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
}
我的应用程序模块 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'

android {
compileSdkVersion 28

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "org.RiverRipple.cibo"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

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 '../..'
}

dependencies {
testImplementation 'junit:junit:4.12'
implementation 'com.google.firebase:firebase-analytics:17.2.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

我的 gradle-wrapper.properties 文件:
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

请告诉我问题是在哪里产生的。

最佳答案

从你的错误

Your app is using an unsupported Gradle project'.


你需要将你的 gradle 更新到最新的
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

关于Firebase SDK 安装问题 Flutter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62722689/

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