0

I am using android studio version 3.2.1. I am facing an error in the Plugin with id 'com.android.application' not found.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion '28.0.3'

    defaultConfig {
        applicationId "ru.ifsoft.chat"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 45
        versionName '3.9'
        multiDexEnabled true
    }
    dexOptions {

        jumboMode true
    }

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

    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
    }

    productFlavors {
    }
}

    dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.mcxiaoke.volley:library:1.0.19'
    implementation 'com.github.chrisbanes.photoview:library:1.2.3'
    implementation 'com.facebook.android:facebook-android-sdk:4.39.0'
    implementation 'com.pkmmte.view:circularimageview:1.1'
    implementation 'com.melnykov:floatingactionbutton:1.3.0'
    implementation 'com.squareup.okhttp:okhttp:2.5.0'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:animated-vector-drawable:27.1.1'
    implementation 'com.android.support:mediarouter-v7:27.1.1'
    implementation 'com.android.support:customtabs:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.balysv:material-ripple:1.0.2'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.google.firebase:firebase-core:16.0.6'
    implementation 'com.google.firebase:firebase-ads:17.1.2'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'com.google.firebase:firebase-analytics:16.0.6'
    implementation 'com.google.android.gms:play-services-gcm:16.0.0'
    implementation 'com.google.android.gms:play-services-ads:17.1.2'
}

apply plugin: 'com.google.gms.google-services'
Jason Aller
  • 3,541
  • 28
  • 38
  • 38
  • It sounds like your Gradle version isn't aligning with your Gradle Plugin version. Check the solution here and give it a shot: https://stackoverflow.com/a/25232725/4592960 – SharpMobileCode Jan 09 '19 at 02:10

1 Answers1

0

It could be you misplaced a curly bracket in your project-level build.gradle.

    buildscript {
        ext.kotlin_version = '1.3.50'
        repositories {
            google()
                maven {url 'https://maven.fabric.io/public'}
            jcenter()

            dependencies {
                classpath 'com.android.tools.build:gradle:3.5.2'
                classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
                classpath 'com.google.gms:google-services:4.3.3'
                classpath 'com.google.firebase:perf-plugin:1.3.1'
                classpath 'io.fabric.tools:gradle:1.31.2'
            }
        }
    } //this is the important bracket, because it closes the buildscript

    allprojects {
        repositories {
            google()
            jcenter()
        }
    }
    [...]

If this doesn't work try to invalidating the cache a restarting in the file-menu.

I hope i am helping

ccc
  • 11
  • 3