Search code examples
androidandroid-gradle-pluginandroidpdfviewer

Error:(16, 0) Could not find method android() for arguments


i got that error 16,0 in pdf viewer when i try to open it in android studio https://github.com/barteksc/AndroidPdfViewer

 buildscript {
 repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.2.3'
    classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
    classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
 }
 allprojects {
repositories {
    jcenter()
}
 }
 android {
     compileSdkVersion 15
    buildToolsVersion '21.1.2'
 }

Solution

  • There are at two build.gradle file for a project with one module - one the project level and another the app level. Looks like you have mixed up both.

    Move the android block to the app level build.gradle file and also don't forget to include minSdkVersion and targetSdkVersion