org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException异常处理
最近在引入新仓库时候,提示报错:
Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method platform() for arguments [com.mpaas.android:mpaas-baseline:10.1.68-16] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
但我之前项目是可以正常引入的。
对比检查下来,发现是项目的gradle版本低了。
因此需要升级gradle版本:
根目录下 >> gradle >> wrapper >> gradle-wrapper.properties文件 >> distributionUrl属性
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip