This message was deleted.
# community-support
s
This message was deleted.
v
How does your build script look like?
You are trying to define a dependency for the
implementation
configuration while the
implementation
configuration does not exist.
m
ill send you the app gradle and the android gradle
app Gradle
Copy code
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion flutter.compileSdkVersion


    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.shoppingworld.usersapp"
        minSdkVersion 19
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true

    }

    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 '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}


apply plugin: 'com.google.gms.google-services'
android Gradle
Copy code
buildscript {
    ext.kotlin_version = '1.6.21'
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.google.gms:google-services:4.3.12'
        classpath 'com.android.tools.build:gradle:4.1.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"



    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(":app")
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

dependencies {
    implementation 'com.android.support:support-annotations:28.0.0'
    implementation 'androidx.annotation:annotation:1.4.0'

}
thank you so much for your help
and this is the error Launching lib/main.dart on Android SDK built for x86 in debug mode... Running Gradle task 'assembleDebug'... FAILURE: Build failed with an exception. * Where: Build file '/Users/mac/AndroidStudioProjects/users_app/android/build.gradle' line: 38 * What went wrong: A problem occurred evaluating root project 'android'.
Could not find method implementation() for arguments [com.android.supportsupport annotations28.0.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
* 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 24s Exception: Gradle task assembleDebug failed with exit code 1
v
As I said,
You are trying to define a dependency for the
implementation
configuration while the
implementation
configuration does not exist.
On the project where you try to define those, dependencies no plugin is applied that would add that configuration. I guess you wanted to add this to the other build script. I highly recommend using Kotlin DSL build scripts, because then your build scripts are immediately type-safe and you have muuuch better IDE support and would e. g. immediately have seen that it is an unresolved symbol. Btw. just in case you are not aware, your build scritps are sprinkled with bad or legacy practices like
subprojects { ...  }
blocks,
allprojects { ... }
blocks, legacy plugin application instead of
plugins { ... }
block, ...
m
thank you for your response sorry for my ignorance, I'm new to app development. if I may ask how could I fix this issue or would I need to start all over and use kotkin DSL?
v
I already told you how to fix it. And the usage of the Kotlin DSL was just a recommendation to have more convenience and reliability when writing the build scripts, whether you follow it or not is up to you.
m
thank you
thank you once again
v
you're welcome