Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:(1, 0) Plugin with id 'com.android.application' not found

This is my first attempt at Android Studio. I installed 0.8.0 and updated to 0.8.2. As soon as a project is created I get the error message:

Error:(1, 0) Plugin with id 'com.android.application' not found

C:\Users\Bob\AndroidStudioProjects\HelloAgain6\app\build.gradle

apply plugin: 'com.android.application'  android {     compileSdkVersion 20     buildToolsVersion "20.0.0"      defaultConfig {         applicationId "com.example.bob.helloagain6"         minSdkVersion 15         targetSdkVersion 20         versionCode 1         versionName "1.0"     }     buildTypes {         release {             runProguard false             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'         }     } }  dependencies {     compile fileTree(dir: 'libs', include: ['*.jar']) } 

and C:\Users\Bob\AndroidStudioProjects\HelloAgain6\build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.  buildscript {     repositories {         jcenter()     }     dependencies {         classpath 'com.android.tools.build:gradle:0.12.+'          // NOTE: Do not place your application dependencies here; they belong         // in the individual module build.gradle files     } }  allprojects {     repositories {         jcenter()     } } 
like image 359
Bob Kusik Avatar asked Jul 17 '14 04:07

Bob Kusik


People also ask

What is a plugin in Android?

The Android Gradle plugin (AGP) is the official build system for Android applications. It includes support for compiling many different types of sources and linking them together into an application that you can run on a physical Android device or an emulator.

What is a Gradle in Android?

Android Studio uses Gradle, an advanced build toolkit, to automate and manage the build process, while allowing you to define flexible custom build configurations. Each build configuration can define its own set of code and resources, while reusing the parts common to all versions of your app.

What is Gradle project in Java?

Gradle is a build automation tool known for its flexibility to build software. A build automation tool is used to automate the creation of applications. The building process includes compiling, linking, and packaging the code. The process becomes more consistent with the help of build automation tools.


2 Answers

Updated Answer (Dec. 2, 2020)

Latest Gradle: 6.5

Version check:

  • ./gradlew -v

How to update:

  • Set URL: ./gradlew wrapper --gradle-version=6.5 --distribution-type=all
  • Update: ./gradlew wrapper

Latest Android Gradle Plugin: 4.1.0

If you add the following code snippet to the top of your build.gradle file. Gradle will update the build tools.

buildscript {     repositories {         google() // For Gradle 4.0+         maven { url 'https://maven.google.com' } // For Gradle < 4.0     }      dependencies {         classpath 'com.android.tools.build:gradle:4.1.0'     } } 

Read more here: https://developer.android.com/studio/build/index.html and about version compatibility here: https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle and https://dl.google.com/dl/android/maven2/index.html.

Original Answer

I had this same error, you need to make sure your Gradle version is compatible with your Android Gradle Plugin.

The latest version of Gradle is 2.0 but you need to use 1.12 in order to use the Android Gradle Plugin.

like image 146
Jared Burrows Avatar answered Oct 13 '22 13:10

Jared Burrows


This can happen if you miss adding the Top-level build file.

Just add build.gradle to top level.

It should look like this

// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript {     repositories {         mavenCentral()     }     dependencies {         classpath 'com.android.tools.build:gradle:0.xx.y'     } }  allprojects {     repositories {         mavenCentral()     } } 

like image 26
Ash Avatar answered Oct 13 '22 13:10

Ash