gpt4 book ai didi

android - 添加注解处理器时,Android Studio会引发重复的类错误

转载 作者:行者123 更新时间:2023-12-02 13:43:23 26 4
gpt4 key购买 nike

我最近才刚开始使用Kotlin进行android开发,所以在android studio上也很傻。
我正在尝试构建一个 super 简单的HelloWorld应用,但出现此错误:

Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor. Please add them to the annotationProcessor configuration. - jetified-kotlin-compiler-embeddable-1.3.72.jar (kotlin-compiler-embeddable-1.3.72.jar) Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with previous behavior. Note that this option is deprecated and will be removed in the future. See https://developer.android.com/r/tools/annotation-processor-error-message.html for more details.



但是当我在依赖项的末尾添加注解处理器时,例如:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
annotationProcessor "org.jetbrains.kotlin:kotlin-compiler-embeddable:$kotlin_version"

}

当我尝试构建时,我遇到了一个新错误:

https://del.dog/pyfunestin

最佳答案

类重复错误可以通过清理项目来解决。首先清理项目并重建它。

关于android - 添加注解处理器时,Android Studio会引发重复的类错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61385895/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com