2016-04-09 2 views
48

Недавно я обновил Android Studio с версии 1.5 до 2.0, но с тех пор я заметил, что количество ошибок и предупреждений увеличилось. Большинство ошибок не имеет смысла. Может кто-то помочь:Большое количество ошибок во время сборки Gradle после обновления до Android Studio 2.0

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":[{}]} 
+1

Те, кто похож на сообщения ProGuard. – CommonsWare

+1

К сожалению, это не сообщения proguard – Ranjan

+2

те же ошибки, все еще ожидающие правильного ответа – yongsunCN

ответ

19

Вы можете избавиться от бессмысленных предупреждений и ошибок, удалив .idea папку, Android Studio 1.5 создан и импортируемый проект в Android Studio 2.0 в качестве Gradle проекта. Он автоматически создаст папку .idea.

+30

Это, к сожалению, ничего не делало в моем случае. – Alice

+2

Это не работает для меня! – GeekHades

+1

@Doug этот работа только один раз. второй раз я получаю «AGPBI: {« kind »:« error »,« text »:« (com.instabug.library.util.i), который не имеет «,» источников »: [{}] } 'etc – Qamar

0

Вы пытались очистить проект и перестроить? В файле build.gradle какая версия у вас есть?

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.0.0' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 
+0

проект уже очищен
Файл уровня проекта build.gradle содержит classpath 'com.android.tools.build:gradle : 2.0.0 ' – Ranjan

1

У меня были почти такие же сообщения после интеграции SimpleXML retrofit2 converter в моем проекте. Я должен был исключить некоторые библиотеки, которые уже были добавлены в Android, чтобы они правильно работали.

Как так:

compile ("com.squareup.retrofit2:converter-simplexml:2.0.2") { 
exclude group: 'xpp3', module: 'xpp3' 
exclude group: 'stax', module: 'stax-api' 
exclude group: 'stax', module: 'stax'} 
17

Добавление -keepattributes EnclosingMethod в Proguard правила подавляет эти ошибки и предупреждения.

Работал для меня как шарм.

Обновление: Добавление -keepattributes EnclosingMethod в Proguard правил на самом деле изменения, как классы затемненные. Это сохраняет необязательные атрибуты, которые обычно необходимы для выполнения вашего кода БЕЗ такой проблемы.

+7

не работал для меня –

+1

также работал для меня - см. [Proguard manual EnclosingMethod] (http://proguard.sourceforge.net/manual/attributes.html) – TmTron

+0

Обратите внимание, что это НЕ подавляет ошибки/предупреждения , это фактически изменяет, как классы запутываются. Это по-прежнему актуально для проблемы наверху, поэтому я не голосую, но описание должно быть исправлено. Для документации есть хорошая ссылка от @TmTron. – rjferguson

1

После последнего обновления бета-версии Android Studio 2.2 я решил проблему, обновив «buildToolsVersion» до последней возможной версии (от 24 до 24.0.1) в приложении build.gradle.

-1

Ответ должен быть здесь NewRelic causing build errors

добавить в proguard-rules.pro

-keep class   org.apache.commons.beanutils.** { *; } 
-keep interface  org.apache.commons.beanutils.** { *; } 
-keep enum   org.apache.commons.beanutils.** { *; } 
+0

проголосовали, потому что ссылка не имеет значения, и она не работает (см. Ниже конфигурацию). –

0

строящей Common Collections будет производить необходимые JARs ...

мой build.gradle выглядит примерно так, как это, с commons-collections исключен & заменен более поздней версией (по-прежнему необходимо построить из исходного кода, так же, как сообщение сообщает, что нужно сделать):

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    // compile 'commons-collections:commons-collections:3.2.2' 
    // compile 'org.apache.commons:commons-collections4:4.1' 
    compile ('org.apache.velocity:velocity:1.7') { 
     exclude group: 'commons-collections', module: 'commons-collections' 
    } 
} 
Смежные вопросы