Ошибка добавления Firebase для развевания проекта в коде VSAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 Ошибка добавления Firebase для развевания проекта в коде VS

Сообщение Anonymous »

Я пытаюсь добавить Firebase в свой проект, но каждый раз, когда появляется эта ошибка: < /p>
[{
"resource": "/c:/Users/User/StudioProjects/gp_femuna/android/app/build.gradle.kts",
"owner": "_generated_diagnostic_collection_name_#5",
"code": "0",
"severity": 8,
"message": "The supplied phased action failed with an exception.\r\nA problem occurred configuring root project 'android'.\r\nBuild file 'C:\\Users\\User\\StudioProjects\\gp_femuna\\android\\build.gradle.kts' line: 1\r\nError resolving plugin [id: 'com.google.gms.google-services', version: '4.4.2', apply: false]\r\nThe request for this plugin could not be satisfied because the plugin is already on the classpath with a different version (4.3.15).",
"source": "Java",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 1,
"endColumn": 1
}]

Это приложение/build.gradle.kts:
plugins {
id("com.android.application")
id("kotlin-android")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin")
id("com.google.gms.google-services")
}

dependencies {
// Import the Firebase BoM
implementation(platform("com.google.firebase:firebase-bom:33.10.0"))

// TODO: Add the dependencies for Firebase products you want to use
// When using the BoM, don't specify versions in Firebase dependencies
implementation("com.google.firebase:firebase-analytics")

// Add the dependencies for any other desired Firebase products
// https://firebase.google.com/docs/androi ... -libraries
}

android {
namespace = "com.example.gp_femuna"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/bu ... on-id.html).
applicationId = "com.example.gp_femuna"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}

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.getByName("debug")
}
}
}

flutter {
source = "../.."
}
< /code>
И это build.gradle.kts root -уровень < /p>
allprojects {
repositories {
google()
mavenCentral()
}
}

plugins {
// ...

// Add the dependency for the Google services Gradle plugin
id("com.google.gms.google-services") version "4.4.2" apply false

}

val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
rootProject.layout.buildDirectory.value(newBuildDir)

subprojects {
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
project.layout.buildDirectory.value(newSubprojectBuildDir)
}
subprojects {
project.evaluationDependsOn(":app")
}

tasks.register("clean") {
delete(rootProject.layout.buildDirectory)
}


Подробнее здесь: https://stackoverflow.com/questions/795 ... in-vs-code
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Android»