Android Studio: Plugin with id ‘android-library’ not found

Instruct Gradle to download Android plugin from Maven Central repository. You do it by pasting the following code at the beginning of the Gradle build file: buildscript { repositories { mavenCentral() } dependencies { classpath ‘com.android.tools.build:gradle:1.1.1’ } } Replace version string 1.0.+ with the latest version. Released versions of Gradle plugin can be found in … Read more

How to define different dependencies for different product flavors

To define a flavor specific dependency you can use proCompile instead of compile in your dependency section. When you run gradle properties you get an overview of automatic created configurations. The correct build file looks like this: buildscript { repositories { mavenCentral() } dependencies { classpath ‘com.android.tools.build:gradle:1.2.3’ } } apply plugin: ‘com.android.application’ repositories { mavenCentral() … Read more

What is the difference between compileSdkVersion and targetSdkVersion?

compileSdkVersion The compileSdkVersion is the version of the API the app is compiled against. This means you can use Android API features included in that version of the API (as well as all previous versions, obviously). If you try and use API 16 features but set compileSdkVersion to 15, you will get a compilation error. … Read more