gpt4 book ai didi

android - 在 Android Studio 2 中构建时出现 "EnclosingMethod"错误

转载 作者:IT老高 更新时间:2023-10-28 21:51:21 25 4
gpt4 key购买 nike

当我在 Android Studio 2 中运行应用程序时,我遇到了构建错误。当我使用早期版本的 Android Studio 时,这些错误不存在。

Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(com.squareup.haha.guava.base.Joiner$1) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is *not* an inner class.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(com.squareup.haha.guava.collect.Iterables$2) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is *not* an inner class.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(com.squareup.haha.guava.collect.Iterables$3) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is *not* an inner class.

这些错误是什么以及如何解决?此外,apk 构建良好,应用程序也运行良好。

最佳答案

2016/09/19 更新

这在 LeakCanary 1.4 中已修复,因此只需升级即可修复它,而无需与 haha 的替代版本混淆。

debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4'

以前

这些警告是由 haha:2.0.2 引起的,它是 leakcanary-android:1.4-beta2 的依赖项。

它已在 haha:2.0.3 中修复,因此您可以通过在依赖项中显式使用较新版本来修复它。为要添加 leakcanary 依赖项的每个 flavor 添加此行。你不需要为 leakcanary-android-no-op 添加它,因为它没有依赖项。

debugCompile 'com.squareup.haha:haha:2.0.3'

关于android - 在 Android Studio 2 中构建时出现 "EnclosingMethod"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36762834/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com