Could not find method api() for arguments [directory 'libs']

I was able to correct this error by updating most dependencies to current version (not sure that necessary, and when the most current version conflicted with a dependency of another component, I reverted one release back and it cleared up the mismatch. At this time, I am using 27.1.0 for appCompat, design. (I use 27.0.3 for build tools tho)

Gradle wrapper to version 4.4 (this was actually prompted for me to do when loading an outdated project and updating the plugin)

Adjusted project build.gradle to use: classpath 'com.android.tools.build:gradle:3.1.1'


For my Java library project I needed to use java-library plugin instead of java:

- apply plugin: 'java'
+ apply plugin: 'java-library'