1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Plugin [id: 'com.google.gms.google-services'] was not found in any of the following...

Discussão em 'Mobile' iniciado por Stack, Outubro 3, 2024 às 11:52.

  1. Stack

    Stack Membro Participativo

    am currently facing this error message whenever I try to run my flutter app I have the google() in my repositories I have checked the dependencies multiple times and I don't know what to do tbh I have also tried asking chat gbt and checking for the solutions on both git hub and stack overflow but nothing seems to fix it
    here are both my build.gradle files

    buildscript {
    repositories {
    google()
    mavenCentral()
    }
    dependencies {
    classpath 'com.android.tools.build:gradle:8.1.0' // Use the latest compatible version of Gradle Plugin
    classpath 'com.google.gms:google-services:4.4.2' // Add the correct version here
    }
    }

    plugins {
    id "com.android.application"
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin"
    id 'com.google.gms.google-services'
    id 'com.google.gms.google-services' version '4.4.2' apply false // Google Services pluginflutter run --verbose
    }

    android {
    namespace = "com.example.sheep_farm"
    compileSdk = 34 // Replace with your actual compile SDK version

    ndkVersion = "25.1.8937393" // Ensure this matches the NDK version used in your project

    defaultConfig {
    applicationId = "com.example.sheep_farm"
    targetSdk = 34 // Replace with your actual target SDK version
    versionCode = 1
    versionName = "farm_app"
    }

    buildFeatures {
    buildConfig = true
    }

    compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
    }

    kotlinOptions {
    jvmTarget = "1.8"
    }

    buildTypes {
    debug {
    // Debug build type configuration
    }
    release {
    minifyEnabled false
    shrinkResources false
    proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    signingConfig signingConfigs.debug
    }
    }
    }

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

    dependencies {
    implementation platform('com.google.firebase:firebase-bom:33.4.0') // Firebase BOM for managing versions

    // Add the Firebase dependencies you need, for example:
    implementation 'com.google.firebase:firebase-analytics' // Analytics
    implementation 'com.google.firebase:firebase-auth' // Auth
    implementation 'com.google.firebase:firebase-messaging' // Messaging
    implementation 'com.google.firebase:firebase-firestore' // Firestore, if needed
    implementation 'com.google.firebase:firebase-storage' // Storage, if needed
    }
    apply plugin: 'com.google.gms.google-services'


    buildscript {
    repositories {
    google()
    mavenCentral()
    }
    dependencies {
    classpath 'com.android.tools.build:gradle:8.1.0' // Gradle Plugin version
    classpath 'com.google.gms:google-services:4.4.2' // Make sure this version is correct
    }
    }

    apply plugin: 'com.android.application'
    apply plugin: 'kotlin-android'
    apply plugin: 'dev.flutter.flutter-gradle-plugin'
    apply plugin: 'com.google.gms.google-services' // Google Services plugin for Firebase

    android {
    namespace = "com.example.sheep_farm"
    compileSdk = 34 // Replace with your actual compile SDK version

    ndkVersion = "25.1.8937393" // Ensure this matches the NDK version used in your projectz

    defaultConfig {
    applicationId = "com.example.sheep_farm"
    targetSdk = 34 // Replace with your actual target SDK version
    versionCode = 1
    versionName = "farm_app"
    }

    buildFeatures {
    buildConfig = true
    }

    compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
    }

    kotlinOptions {
    jvmTarget = "1.8"
    }

    buildTypes {
    debug {
    // Debug build type configuration
    }
    release {
    minifyEnabled false
    shrinkResources false
    proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    signingConfig signingConfigs.debug
    }
    }
    }

    flutter {
    source = "../.." // Flutter source directory
    }
    plugins {
    id 'com.android.application'

    // Add the Google services Gradle plugin
    id 'com.google.gms.google-services'
    }

    dependencies {
    implementation platform('com.google.firebase:firebase-bom:33.3.0') // Firebase BOM for managing versions

    // Add the Firebase dependencies you need, for example:
    implementation 'com.google.firebase:firebase-analytics' // Analytics
    implementation 'com.google.firebase:firebase-auth' // Auth
    implementation 'com.google.firebase:firebase-messaging' // Messaging
    implementation 'com.google.firebase:firebase-firestore' // Firestore, if needed
    implementation 'com.google.firebase:firebase-storage' // Storage, if needed
    }
    apply plugin: 'com.google.gms.google-services'

    Continue reading...

Compartilhe esta Página