1、Cannot invoke method buildToolsVersion() on null object
原因:在xxx-project/build.gradle中,compileSdkVersion和buildToolsVersion放置在了同一行。如下:
compileSdkVersion 25 buildToolsVersion "25.0.2"
解决方法:分开两行放置即可,如下:
compileSdkVersion 25
buildToolsVersion "25.0.2"