这是gradle版本原因造成的,如果不想升级gradle版本到2.3.2以上,需要使用原来低版本的方法。
Gradle DSL method not found: 'google()'
Possible causes:<ul><li>The project 'BottomNavigation' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 2.3.2 and sync project</li><li>The project 'BottomNavigation' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file</li><li>The build file may be missing a Gradle plugin.
Apply Gradle plugin</li>
解决办法:将google()修改为:
// google() maven { url 'https://maven.google.com/' name 'Google' }
Gradle DSL method not found: 'testImplementation()'
Possible causes:<ul><li>The project 'BottomNavigation' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 2.3.2 and sync project</li><li>The project 'BottomNavigation' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file</li><li>The build file may be missing a Gradle plugin.
Apply Gradle plugin</li>
解决办法:将testImplementation修改为testCompile
将implementation修改为compile
androidTestImplementation修改为androidTestCompile