Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Error: (8, 0) Plugin with id 'android' not found

I have installed Android Studio (0.6.1) on OS X (10.9.3) and Gradle 1.1 using Brew (brew install gradle). However, I can't get my first Hello World! project... Please help me solve this issue

build.gradle:

    buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.11.+'
    }
}

apply plugin: 'android'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 19
    buildToolsVersion '19.1'
    defaultConfig {}
    productFlavors {}
}

dependencies {
}

Error message:

Error:(8, 0) Plugin with id 'android' not found.

Getting Build failed with an Exception Android Studio 0.4.3 and 0.4.4 post and Android Studio: Plugin with id 'android-library' not found post does not solves the problem...

Second post I linked returns this error message:

Error:The project is using an unsupported version of Gradle. Please use version 1.10. Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.) Fix Gradle wrapper and re-import project Gradle settings

like image 605
user927584 Avatar asked Jun 19 '14 04:06

user927584


People also ask

What went wrong plugin ID com Android application '] was not found in any of the following sources?

You need to update to the latest gradle version to solve this issue. It might show a popup asking your permission to update gradle , please update and it will download the latest distribution automatically and the issue will be resolved.


2 Answers

It seems you have missed to add android gradle plugin dependency in dependencies block.

Replace the top buildScript section by this and sync your project with gradle

 buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.11.+'
    }
 }

 apply plugin: 'android'

 android {
      compileSdkVersion 19
      buildToolsVersion '19.1.0'
      defaultConfig {
          applicationId 'YOUR_APP_PACKAGE'
          minSdkVersion 9
          targetSdkVersion 17
      }
      buildTypes {
          release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
          }
      }
      productFlavors {   }
  }

  dependencies {

   }
like image 194
Piyush Agarwal Avatar answered Nov 16 '22 17:11

Piyush Agarwal


build.gradle file inside my "app" folder: PATH: /home/work/ProjectName/app/build.gradle

android {
     compileSdkVersion 19
     buildToolsVersion '19.1.0'

defaultConfig {
    minSdkVersion 11
    targetSdkVersion 19
    versionCode 1
    versionName '1.0'
}


 dependencies {
  compile 'com.android.support:support-v4:18.0.0'
  compile 'com.android.support:appcompat-v7:+'

 }
}

build.gradle file outside my "app" folder: PATH: /home/work/ProjectName/build.gradle

buildscript {
repositories {
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:0.11.+'
}
}

allprojects {
repositories {
    mavenCentral()
}
}

Note after all these update synchronise your project with gradle file

like image 37
sherin Avatar answered Nov 16 '22 16:11

sherin