Home > Mobile >  How to fix gradle which stopped working - error while syncing?
How to fix gradle which stopped working - error while syncing?

Time:11-16

I have an Issue with gradle in my Android Project. I feel stupid I could't solve this Issue myself. I closed the project yesterday evening end reopend it this morning, So gradle wasn't touched at all. This morning i got the following error

    Could not compile build file 'D:\Code\Android\workouttracker\app\build.gradle'.
> startup failed:
  build file 'D:\Code\Android\workouttracker\app\build.gradle': 87: Unexpected input: '{' @ line 87, column 14.
     dependencies {

So i guessed it must be a missing braket, but I couldn't find one in my build gradle, maybe I am stupid or blind. I get the same error when I run gradlew in the project direcroy

Here is my build.gradle (After me trieing to fix it)

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'


configurations.implementation {
        exclude group: 'org.jetbrains' , module:'annotations'
        exclude group: 'org.jetbrains.kotlin' , module:'kotlin-stdlib'
        exclude group: 'com.intellij', module:'annotations'
        exclude group: 'com.intellij', module:'annotations'
        exclude group: 'com.intellij', module:'annotations'
}

android {
    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }

    compileSdkVersion 30
    buildToolsVersion '32.0.0-rc1'
    defaultConfig {
        applicationId 'ch.workouttracker'
        minSdkVersion 28
        targetSdkVersion 30
        versionCode 901
        versionName '0.9.0.1'
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        resConfigs "de" // And any other languages you support
    }

    signingConfigs {
        release {
            storeFile file("C:\\Users\\DonBolli\\.android\\debug.keystore")
            storePassword ANDROID_STORE_PASSWORD
            keyAlias 'workouttrackerkey'
            keyPassword ANDROID_KEY_PASSWORD
        }
        debug {
            storeFile file("C:\\Users\\DonBolli\\.android\\debug.keystore")
            storePassword ANDROID_STORE_PASSWORD
            keyAlias 'workouttrackerkey'
            keyPassword ANDROID_KEY_PASSWORD
        }
    }

    buildTypes {
        debug {
            minifyEnabled false
            signingConfig signingConfigs.debug
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.md'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.md'
        exclude 'META-INF/DEPENDENCIES'

    }

    defaultConfig {
        vectorDrawables.useSupportLibrary = true
    }

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

allprojects {
    repositories {
        mavenCentral()
        maven { url = "https://maven.fabric.io/public" }
    }
}

dependencies {

    implementation fileTree(include: ['*.jar'], dir: 'libs')
    
    //Firebase
    implementation platform('com.google.firebase:firebase-bom:29.0.0')
    implementation ("com.google.firebase:firebase-core:20.0.0") {
        exclude group: "com.android.support", module: "support-v4"
    }
    implementation 'com.google.firebase:firebase-messaging:23.0.0'
    implementation 'com.google.firebase:firebase-analytics:20.0.0'
    implementation 'com.google.firebase:firebase-plugins:2.0.0'
    implementation 'com.google.firebase:firebase-ml-vision:24.0.0'
    implementation ("com.google.firebase:firebase-auth:21.0.1") {
        exclude group: "com.android.support", module: "support-v4"
    }
    implementation 'com.google.firebase:firebase-database:20.0.2'
    implementation 'com.google.firebase:firebase-storage:20.0.0'


    //CrashAlyrics
    implementation 'com.google.firebase:firebase-crashlytics'
    implementation 'com.google.firebase:firebase-analytics'


    //Graphview
    implementation 'com.jjoe64:graphview:4.2.1'
    implementation 'org.apache.commons:commons-lang3:3.4'


    //Google Play
    implementation ("com.google.android.gms:play-services-base:17.6.0") {
        exclude group: "com.android.support", module: "support-v4"
    }
    implementation 'com.google.android.gms:play-services-auth:19.2.0'


    //Support
    implementation "androidx.appcompat:appcompat:1.1.0"
    implementation "androidx.appcompat:appcompat-resources:1.1.0"
    implementation "androidx.navigation:navigation-fragment-ktx:2.2.1"
    implementation "androidx.drawerlayout:drawerlayout:1.0.0"
    implementation "androidx.gridlayout:gridlayout:1.0.0"
    implementation "androidx.preference:preference:1.1.0"
    implementation "androidx.recyclerview:recyclerview:1.1.0"
    implementation "androidx.cardview:cardview:1.0.0"

    implementation "io.reactivex.rxjava2:rxjava:2.2.13"
    implementation "io.reactivex.rxjava2:rxandroid:2.1.1"

    // Gradle
    implementation com.android.tools.build:gradle);

    //Glide
    implementation 'com.github.bumptech.glide:glide:4.11.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'

    /**
     * dependency to request the runtime permissions.
     */
    implementation 'com.karumi:dexter:4.2.0'

    // code generator for view
    implementation "com.jakewharton:butterknife:10.2.0"
    annotationProcessor "com.jakewharton:butterknife-compiler:10.2.0"
    testImplementation 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'

CodePudding user response:

There was an error inside the dependencies

// Gradle
implementation com.android.tools.build:gradle);

Changed this to

// Gradle
implementation 'com.android.tools.build:gradle'
  • Related