Open muezz opened 3 weeks ago
Please post both build.gradle
files. android/build.gradle and android/app/build.gradle. Thanks 👍
Hey @russellwheatley,
Here is my project level build.gradle
:
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
}
This is my app level build.gradle
:
plugins {
id "com.android.application"
// START: FlutterFire Configuration
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
// 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'
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
namespace "app.iuhabit"
compileSdk 34
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
coreLibraryDesugaringEnabled true
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "app.iuhabit"
minSdkVersion 24
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
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.release
ndk {
debugSymbolLevel 'FULL'
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
}
}
}
}
flutter {
source '../..'
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
}
@russellwheatley Did you get a chance to take a look at this?
Hey @muezz, could you also post your settings.gradle
file as well, please? I should've said that in the original post, sorry 😓
@russellwheatley Here it is:
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '7.3.0' apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}
include ":app"
I was also facing this issue. I fixed the issue by adding.
id "com.google.gms.google-services" version "4.4.0" apply false
id "com.google.firebase.firebase-perf" version "1.4.2" apply false
id "com.google.firebase.crashlytics" version "2.9.9" apply false
To the plugins section in my settings.gradle file.
The complete settings.gradle file is as follows:
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '8.2.2' apply false
id "org.jetbrains.kotlin.android" version "2.0.0" apply false
// START: FlutterFire Configuration
id "com.google.gms.google-services" version "4.4.0" apply false
id "com.google.firebase.firebase-perf" version "1.4.2" apply false
id "com.google.firebase.crashlytics" version "2.9.9" apply false
// END: FlutterFire Configuration
}
include ":app"
Although I expected the flutterfire confiure command to do this for me.
@hussain-mustafa990 I fixed this by creating a new project and adding all of my dependencies and then running the flutterfire CLI command along with pod install
.
Is there an existing issue for this?
CLI Version
1.0.0
Firebase Tools version
13.10.2
Flutter Doctor Output
Description
After configuring my app with firebase using flutterfire, I get an error in my
app/build.gradle
fileSteps to reproduce
flutterfire configure --project=my-project
flutter run
Where: Build file '/Users/abdulmuezz/Documents/Projects/iuhabit/android/app/build.gradle' line: 4
What went wrong: Plugin [id: 'com.google.gms.google-services'] was not found in any of the following sources:
Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
Included Builds (None of the included builds contain this plugin)
Plugin Repositories (plugin dependency must include a version number for this source)
Try:
Get more help at https://help.gradle.org
BUILD FAILED in 690ms Running Gradle task 'assembleDebug'... 1,156ms Error: Gradle task assembleDebug failed with exit code 1