Hello So I am getting this Error: Running Gradle t...
# community-support
i
Hello So I am getting this Error: Running Gradle task 'assembleDebug'... FAILURE: Build failed with an exception. * Where: Build file 'C:\Users\Dell\Downloads\Fyp\android\build.gradle' line: 11 * What went wrong: A problem occurred evaluating root project 'android'.
Supplied String module notation 'com.google.gms.google-services' is invalid. Example notations: 'org.gradlegradle core2.2', 'org.mockitomockito core1.9.5:javadoc'.
* 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 12s. Here is my build.gradle file:
Copy code
plugins {
    id "com.android.application"
    id 'com.google.gms.google-services'
    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.fyp"
    compileSdkVersion 33
    ndkVersion flutter.ndkVersion

    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/build/application-id.html>).
        applicationId "com.example.fyp"
        // 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>.
        minSdkVersion 21
        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
        }
    }
}

flutter {
    source '../..'
}
apply plugin: 'com.google.gms.google-services'

dependencies {
    classpath 'com.google.gms:google-services:4.4.2'
}
Can anyone please help? Thank you
v
Are you sure you show the relevant build script? Besides that you apply the gms services plugin twice and have a dependency that will most likely fail to work, the error you showed is not present and specially not at the given line.
i
Yes I am. The given code and error are from the same project
The thing is when I open up my emulator in Android Studio and run my program this error pops up.
v
Can you please couble-check whether that really is
C:\Users\Dell\Downloads\Fyp\android\build.gradle
, because the error speaks about line 11 in that file and that is
Copy code
localPropertiesFile.withReader('UTF-8') { reader ->
in what you showed.