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 ?
This issue comes when you upload new upgrade version on google play store and after upload most users click on retain and then submit. Don't click on Retain just upload and submit. Your apk file uploaded successfully and Retain file automatically discard and set in deactivate mode.
Remember : Make sure your put all details of new update different to older version.
class
android.support.annotation.Keep
is what I use (Android Studio3.1.2
) ...there are further flags to control which annotations to keep:
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:
I removed the "multiDexEnabled true" from app's build gradle defaultConfig and the WARNING goes away:
good luck)
Gradle version: 3.1.4
MultiDex: Enabled
In my case, I forgot to add translation for some string resources. No error/warning after adding.
You are missing a space between the wildcard
*
and the keywordextends
. 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.