Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Large number of errors during Gradle build after upgrading to Android Studio 2.0

Recently, I upgraded Android Studio from version 1.5 to 2.0 but since then I observe that the number of errors and warnings has increased. Most of the errors do not make sense. Can someone please help:

AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.validator.ValidatorResources$1) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.digester.ExtendedBaseRules$1) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.beanutils.BeanMap$5) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.beanutils.BeanMap$6) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.beanutils.BeanMap$8) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.beanutils.BeanMap$9) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.beanutils.BeanMap$1) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.beanutils.BeanMap$10) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.beanutils.BeanMap$11) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.beanutils.BeanMap$12) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.beanutils.BeanMap$2) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.beanutils.BeanMap$3) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.beanutils.BeanMap$4) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.beanutils.BeanMap$7) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.beanutils.BeanUtilsBean$1) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.beanutils.WrapDynaClass$1) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.beanutils.WrapDynaClass$2) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} AGPBI: {"kind":"error","text":"(org.apache.commons.beanutils.locale.LocaleBeanUtilsBean$1) that doesn\u0027t come with an","sources":[{}]} AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} 
like image 730
Ranjan Avatar asked Apr 09 '16 20:04

Ranjan


People also ask

Why is my Gradle build failing?

If gradle --version works, but all of your builds fail with the same error, it is possible there is a problem with one of your Gradle build configuration scripts. You can verify the problem is with Gradle scripts by running gradle help which executes configuration scripts, but no Gradle tasks.

What is gradle error in Android Studio?

In some cases when your Gradle files are deleted or corrupted you will not be able to download new Gradle files in android studio. In this case, we have to delete the Gradle files which are present already and then again sync your project to download our Gradle files again.

How long does it take to sync gradle in Android Studio?

From 4 min to 1 min.


2 Answers

You can get rid of the meaningless warnings and errors by deleting the .idea folder that Android Studio 1.5 created and importing the the project into Android Studio 2.0 as a gradle project. It will recreate the .idea folder automatically.

like image 171
Doug Stevenson Avatar answered Sep 17 '22 19:09

Doug Stevenson


Adding -keepattributes EnclosingMethod to proguard rules suppresses these errors and warnings.

Worked for me like a charm.

Update : Adding -keepattributes EnclosingMethod to proguard rules actually changes how the classes are obfuscated. This preserves the optional attributes that are typically necessary for your code to be executed WITHOUT such issue.

like image 26
Thilaw Fabrice Avatar answered Sep 21 '22 19:09

Thilaw Fabrice