build.gradle这行
configurations.compile.exclude module: 'org.eclipse.paho.client.mqttv3'
报错
Could not get unknown property 'compile' for configuration container of type org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.
最后还是gradle版本问题
gradle-wrapper.properties修改gradle版本为6.7.1
distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-bin.zip
build.gradle修改为
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
}
问题解决,参考google官网
https://developer.android.google.cn/studio/releases/gradle-plugin?hl=zh-cn#updating-plugin