gpt4 book ai didi

Android Studio 警告 - InnerClass 注释缺少相应的 EnclosureMember 注释

转载 作者:IT老高 更新时间:2023-10-28 22:10:11 25 4
gpt4 key购买 nike

我最近升级到 Android Studio 3.1,并在使用 Java 项目构建 Kotlin 时收到以下警告。

InnerClass annotations are missing corresponding EnclosingMemberannotations. Such InnerClass annotations are ignored.

Message {kind=WARNING, text=InnerClass annotations are missingcorresponding EnclosingMember annotations. Such InnerClass annotationsare ignored., sources=[Unknown source file]}

这是我的 Gradle 详细信息。

android {
compileSdkVersion 27
//buildToolsVersion '27.0.3'
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
applicationId "org.myapp"
versionCode generateVersionCode()
//...
multiDexEnabled true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

它不会引导我找到问题所在。如何找到有问题的代码?

enter image description here

最佳答案

可能是因为某些注解混淆了,所以添加proguard规则即可:

-keepattributes *注解*
-keep @**annotation** class * {*;}

对我来说效果很好。

关于Android Studio 警告 - InnerClass 注释缺少相应的 EnclosureMember 注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49517898/

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