问题1 Could not find method compile() for arguments XXX
Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method compile() for arguments [{group=org.apache.commons, name=commons-collections4, version=4.1}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
查看是由于gradle plugin版本较高,需将build.gradle配置文件中 compile 替换为 implementation 后重载项目即可解决
修改前
dependencies{
compile group: 'org.apache.commons', name: 'commons-collections4', version: "${rootProject.ext.version.commons_collections4}"
compile group: 'org.apache.commons', name: 'commons-lang3'
compile group: 'org.apache.commons', name: 'commons-text', version: "${rootProject.ext.version.commons_text}"