- Some problems were found with the configuration of task ‘:app:generateSafeArgsDebug’ (type ‘ArgumentsGenerationTask’).
Type ‘androidx.navigation.safeargs.gradle.ArgumentsGenerationTask’ property ‘applicationId’ is missing an input or output annotation.
解决方案:是因为navigation-safe-args-gradle-plugin插件版本太低引起,修改下版本号即可,例如
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:1.0.0"
修改为
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.0"
- Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository ‘maven(http://maven.aliyun.com/nexus/content/groups/public)’ to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See …
解决方案:设置对应的maven库的allowInsecureProtocol 属性设置
修改为
maven {
allowInsecureProtocol = true
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
- this.activity?.let{…}
let、also等kotlin相关的关键字标红,需要在project的build.gradle文件中添加
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
}
在app的build.gradle文件中添加
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10"
}