FAILURE: сборка не удалась с исключением.
- Где:
Файл сборки 'C:\Users\82102\Documents\Folder\Coding\Flutter\kyunggi_life\android\app\build.gradle' строка: 4 - Что пошло не так:
Плагин [id: 'com.google.gms.google-services'] не найден в любом из следующих источников:
- Плагины Gradle Core (плагин отсутствует в ' org.gradle')
- Репозитории плагинов (зависимость плагина должна включать номер версии для этого источника)
- Попробуйте:
Запустите с опцией --info или --debug, чтобы получить больше результатов журнала.
Запустите с --scan, чтобы получить полную информацию.
Дополнительную помощь можно получить на https://help.gradle.org.< /p>
ОШИБКА СБОРКИ через 1 с
Выполнение задачи Gradle 'assembleDebug'... 2,064 мс
Ошибка: сбой задачи Gradle assembleDebug с кодом завершения 1
Я уже около трёх часов пытаюсь решить проблему. Я видел решения подобных проблем, но не смог их применить, потому что плохо их понимал.
В некоторой степени кажется очевидным, что что-то не так со следующим 2 кода.
app/build.gradle
plugins {
id "com.android.application"
// START: FlutterFire Configuration
id 'com.google.gms.google-services'
// END: FlutterFire Configuration
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
android {
namespace "com.example.kyunggi_life"
compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
ndkVersion "26.1.10909125"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/bu ... on-id.html).
applicationId "com.example.kyunggi_life"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/and ... figuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
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
}
}
}
tasks.whenTaskAdded { task ->
if (task.name == 'processDebugGoogleServices') {
task.mustRunAfter 'mapDebugSourceSetPaths'
}
}
flutter {
source '../..'
}
dependencies {}
apply plugin: 'com.google.gms.google-services'
android/build.gradle
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath 'com.google.gms:google-services:4.3.10'
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
Я попробовал выполнить поиск в Интернете следующим образом.
Добавить
ndkVersion "26.1.10909125",
apply plugin: 'com.google.gms.google-services',
tasks.whenTaskAdded { task ->
if (task.name == 'processDebugGoogleServices') {
task.mustRunAfter 'mapDebugSourceSetPaths'
}
}
в app/build.gradle
Проверьте
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath 'com.google.gms:google-services:4.3.10'
}
}
```,
in android/build.gradle
Подробнее здесь: https://stackoverflow.com/questions/785 ... adle-issue