Я пытаюсь добавить 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
Ошибка добавления Firebase для развевания проекта в коде VS ⇐ Android
Форум для тех, кто программирует под Android
-
Anonymous
1742069372
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/android/setup#available-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/build/application-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)
}
Подробнее здесь: [url]https://stackoverflow.com/questions/79510822/error-adding-firebase-to-flutter-project-in-vs-code[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия