I am facing the following error:
PS C:UsersschooFlutterProjectsfirebasecheck> flutterfire configure --project=firesbasecheck
i Found 3 Firebase projects. Selecting project firesbasecheck.
✔ Which platforms should your configuration support (use arrow keys & space to select)? · android, ios, macos, web, windows
✔ Which Android application id (or package name) do you want to use for this configuration, e.g. 'com.example.app'? · "com.example.firebasecheck"
i Firebase android app "com.example.firebasecheck" is not registered on Firebase project firesbasecheck.
⠹ Registering new Firebase android app on Firebase project firesbasecheck.
FirebaseCommandException: An error occured on the Firebase CLI when attempting to run a command.
COMMAND: firebase apps:create android firebasecheck (android) --package-name="com.example.firebasecheck" --json --project=firesbasecheck
ERROR: Failed to create Android app for project firesbasecheck. See firebase-debug.log for more info.
I have logged out firebase and re login but still didn’t get any solution.
Basically i’m getting error after selecting all the platforms it asks for my android application id , I’ve provided application id inside double quotes and single quotes too but didn’t work after that i’m getting error firebase command exception
this is the firebase-debug.log
file
[debug] [2024-08-27T06:52:39.610Z] ----------------------------------------------------------------------
[debug] [2024-08-27T06:52:39.612Z] Command: C:Program Filesnodejsnode.exe C:UsersschooAppDataRoamingnpmnode_modulesfirebase-toolslibbinfirebase.js apps:create android firebasecheck (android) --package-name='com.example.firebasecheck' --json --project=firesbasecheck
[debug] [2024-08-27T06:52:39.613Z] CLI Version: 13.15.4
[debug] [2024-08-27T06:52:39.613Z] Platform: win32
[debug] [2024-08-27T06:52:39.613Z] Node Version: v20.12.2
[debug] [2024-08-27T06:52:39.613Z] Time: Tue Aug 27 2024 12:22:39 GMT+0530 (India Standard Time)
[debug] [2024-08-27T06:52:39.613Z] ----------------------------------------------------------------------
[debug]
[debug] [2024-08-27T06:52:39.615Z] >>> [apiv2][query] GET https://firebase-public.firebaseio.com/cli.json [none]
[debug] [2024-08-27T06:52:39.658Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2024-08-27T06:52:39.658Z] > authorizing via signed-in user ([email protected])
[info] Create your ANDROID app in project firesbasecheck:
[debug] [2024-08-27T06:52:39.661Z] >>> [apiv2][query] POST https://firebase.googleapis.com/v1beta1/projects/firesbasecheck/androidApps [none]
[debug] [2024-08-27T06:52:39.661Z] >>> [apiv2][body] POST https://firebase.googleapis.com/v1beta1/projects/firesbasecheck/androidApps {"displayName":"firebasecheck (android)","packageName":"'com.example.firebasecheck'"}
[debug] [2024-08-27T06:52:39.672Z] *** [apiv2] error from fetch(https://firebase-public.firebaseio.com/cli.json, {"headers":{},"method":"GET"}): FetchError: request to https://firebase-public.firebaseio.com/cli.json failed, reason: connect ECONNREFUSED 127.0.0.1:443
[warn] ! Unable to fetch the CLI MOTD and remote config. This is not a fatal error, but may indicate an issue with your network connection.
[debug] [2024-08-27T06:52:39.672Z] Failed to fetch MOTD FirebaseError: Failed to make request to https://firebase-public.firebaseio.com/cli.json
[debug] [2024-08-27T06:52:40.289Z] <<< [apiv2][status] POST https://firebase.googleapis.com/v1beta1/projects/firesbasecheck/androidApps 400
[debug] [2024-08-27T06:52:40.289Z] <<< [apiv2][body] POST https://firebase.googleapis.com/v1beta1/projects/firesbasecheck/androidApps {"error":{"code":400,"message":"Request contains an invalid argument.","status":"INVALID_ARGUMENT"}}
[debug] [2024-08-27T06:52:40.290Z] HTTP Error: 400, Request contains an invalid argument.
[debug] [2024-08-27T06:52:40.690Z] FirebaseError: HTTP Error: 400, Request contains an invalid argument.
at responseToError (C:UsersschooAppDataRoamingnpmnode_modulesfirebase-toolslibresponseToError.js:49:12)
at RetryOperation._fn (C:UsersschooAppDataRoamingnpmnode_modulesfirebase-toolslibapiv2.js:305:77)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[error]
[error] Error: Failed to create Android app for project firesbasecheck. See firebase-debug.log for more info.
Here it is app level build.gradle file:
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"
}
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.firebasecheck"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.firebasecheck"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdk = flutter.minSdkVersion
targetSdk = 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
}
}
}
flutter {
source = "../.."
}
and here it is android level build.gradle
file:
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
}