Android studio警告 - InnerClass注释缺少相应的EnclosingMember注释

j2e*_*nue 26 android java-annotations

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

InnerClass注释缺少相应的EnclosingMember注释.这样的InnerClass注释被忽略.

消息{kind = WARNING,text = InnerClass注释缺少相应的EnclosingMember注释.这样的InnerClass注释被忽略.,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
}
Run Code Online (Sandbox Code Playgroud)

它并没有指出我的问题所在.如何找到有问题的代码?

在此输入图像描述

duj*_*chi 13

这可能是因为某些注释被混淆了,所以只需添加proguard规则:

-keepattributes*Annotation*
-keep @**annotation**class*{*;}

它对我很好.