android studio 3.1 Warning: The rule `-keep public class *extends java.lang.annotation.Annotation {

i recently upgraded android studio but im not able to find the source of the following issue reported in android studio 3.1:

Warning: The rule `-keep public class *extends java.lang.annotation.Annotation {

the warning seems to be cut off perhaps and missing information. but it looks like a proguard issue although i am getting this warning when building debug variant. i checked my proguard files and i dont have a line that matches that exactly. i searched the entire project. any ideas on the root cause ?


As mentioned in the question's comments by @arcone1, @Vincent Mattana & confirmed by @random, the issue is resolved in Android Studio 3.2.

From the issue in Google Issue Tracker:

To clarify, this is a warning, not an error, from R8, which we use to compute the list of classes for the main dex, in legacy multidex variant. It does not affect the output, and it should not cause build nor runtime failures. I am working on a fix to change this keep rule to "-keep public class * implements java.lang.annotation.Annotation", which is semantically the same, and removes the warning.

So, just ignore it for now or go bleeding edge with Canary (tread at your own risk).

UPDATE: 3.2 is out!

android/testing-samples, android studio 3.1 Warning: The rule `-keep public class *extends java.lang.​annotation.Annotation {. i recently upgraded android studio but im not able to find the source of the following issue reported in android studio 3.1: Warning: The rule `-keep public class *extends java.lang.annotation.Annotation {


You are missing a space between the wildcard * and the keyword extends. The warning itself probably does not come from ProGuard but from the builtin shrinker of google.

If you can not find it in your project, then it is most likely a broken rule from a consumer Proguard file included in of the the dependent aar files.

android, I've stumbled upon an issue after updating gradle plugin to 3.1.1. Warning: The rule `-keep public class *extends java.lang.annotation. I've opened a feature request to make Android Studio automatically apply the fix for  i recently upgraded android studio but im not able to find the source of the following issue reported in android studio 3.1: Warning: The rule `-keep public class *extends java.lang.annotation.Annotation {


I got same issue because of "multiDexEnabled true" setting in gradle defaultConfig.

I resolved this issue by adding multidex dependency "implementation 'com.android.support:multidex:1.0.3'"

android {
defaultConfig {
    ...
    multiDexEnabled true
}
...
}

dependencies {
  implementation 'com.android.support:multidex:1.0.3'
}

Reference : https://developer.android.com/studio/build/multidex

After Updating Android Studio 3.1, I am getting these warnings after , recientemente actualicé Android studio pero no puedo encontrar la fuente del siguiente Warning: The rule `-keep public class *extends Java.lang.annotation. j'ai récemment mis à niveau android studio, mais je ne suis pas en mesure de trouver la source de la question suivante signalée dans android studio 3.1: Warning: The rule `-keep public class *extends java.lang.annotation.Annotation {


I removed the "multiDexEnabled true" from app's build gradle defaultConfig and the WARNING goes away:

defaultConfig {
    ...

    //multiDexEnabled true
}

dexOptions {
    javaMaxHeapSize "Xg"
}

good luck)

Improve code inspection with annotations, Android Issues Warnings. Warning: The rule `-keep public class *extends java.​lang.annotation. For java compiler warning, I've tried to fix my proguard file. Warning: The rule `-keep public class *extends java.lang.annotation.Annotation { *; }` uses extends but actually matches implements. I've opened a feature request


class android.support.annotation.Keep is what I use (Android Studio 3.1.2) ...

-keep @interface android.support.annotation.Keep
-keep @android.support.annotation.Keep class *
-keepclasseswithmembers class * {
    @android.support.annotation.Keep <fields>;
}
-keepclasseswithmembers class * {
    @android.support.annotation.Keep <methods>;
}

there are further flags to control which annotations to keep:

-keepattributes RuntimeVisibleAnnotations
-keepattributes AnnotationDefault
-keepattributes *Annotation*

one can get the raw output by running ./gradlew assembleRelease in the terminal tab.

when nothing in the project's ProGuard configuration refers to Annotation, this warning might originate from the "consumer" rules of some referenced library, to be obfuscated at build time.

hence it appears to be a harmless warning, one can possibly mute it:

-dontwarn java.lang.annotation.Annotation

Learn how annotations allow you to provide hints to code inspections Note that although annotation conflicts generate warnings, these warnings do not prevent your app If all methods in a class share the same threading requirement, you For example, new Java developers often mistakenly think that  No Errors but show a Warning "Warning: The rule `-keep public class *extends java.lang.annotation.Annotation " and looking now what meen this messages. 🎉 1


यह मुद्दा तब आता है जब आप Google play store पर नया अपग्रेड वर्जन अपलोड करते हैं और अपलोड होने के बाद ज्यादातर यूजर्स रिटेन पर क्लिक करते हैं और फिर सबमिट करते हैं