Не удалось собрать: не удалось получить неизвестное свойство «android» для проекта «:firebase_core» в проекте Flutter.Android

Форум для тех, кто программирует под Android
Ответить Пред. темаСлед. тема
Anonymous
 Не удалось собрать: не удалось получить неизвестное свойство «android» для проекта «:firebase_core» в проекте Flutter.

Сообщение Anonymous »

Я пытаюсь создать приложение Flutter для Android с помощью команды apk flutter build, но сборка завершается с ошибкой:

Код: Выделить всё

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':firebase_core'.
> Failed to notify project evaluation listener.
> Could not get unknown property 'android' for project ':firebase_core' of type org.gradle.api.Project.
> Could not get unknown property 'android' for project ':firebase_core' of type org.gradle.api.Project.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 953ms
Running Gradle task 'assembleRelease'...                         1.604ms
Gradle task assembleRelease failed with exit code 1

I try with this configurations
Файлы конфигурации
settings.gradle

Код: Выделить всё

include ':app'
include ':firebase_core'
project(':firebase_core').projectDir = new File(rootProject.projectDir, '../../AppData/Local/Pub/Cache/hosted/pub.dev/firebase_core-3.9.0/android')
Build.gradle на уровне проекта

Код: Выделить всё

buildscript {
ext {
compileSdkVersion = 33
minSdkVersion = 21
targetSdkVersion = 33
}

repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.2'
classpath 'com.google.gms:google-services:4.3.15'
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}
Build.gradle на уровне приложения

Код: Выделить всё

android {
compileSdkVersion 33
defaultConfig {
applicationId "com.gustaga.app"
minSdkVersion 21
targetSdkVersion 33
versionCode 1
versionName "1.0"
}

buildTypes {
release {
signingConfig signingConfigs.debug
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

flutter {
source = "../.."
}

dependencies {
implementation project(':firebase_core')
implementation 'com.google.firebase:firebase-core:21.1.1'
implementation 'com.google.firebase:firebase-database:20.0.5'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
firebase_core build.gradle

Код: Выделить всё

buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.2'
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 33

defaultConfig {
minSdkVersion 21
targetSdkVersion 33
}

lintOptions {
disable 'InvalidPackage'
}
}

dependencies {
implementation 'com.google.firebase:firebase-core:21.1.1'
}
Я убедился, что все конфигурации верны, но проблема не устранена. Любая помощь будет принята с благодарностью!

Подробнее здесь: https://stackoverflow.com/questions/792 ... irebase-co
Реклама
Ответить Пред. темаСлед. тема

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

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

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

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

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

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