Android工程一些编译报错的解决方案
Posted Winston Wood
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Android工程一些编译报错的解决方案相关的知识,希望对你有一定的参考价值。
- 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"
以上是关于Android工程一些编译报错的解决方案的主要内容,如果未能解决你的问题,请参考以下文章
错误记录Android Studio 编译报错 ( Could not determine java version from ‘11.0.8‘. | Android Studio 降级 )(代码片段
错误记录Android Studio 编译报错 ( Could not determine java version from ‘11.0.8‘. | Android Studio 降级 )(代码片段