Android编译错误, Ignoring InnerClasses attribute for an anonymous inner class

今天在做android项目时,加入第三方包,一编译就报错。
错误如下:
[2012-01-13 14:51:25 - xxx] Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.xxx.xxx.xxx$1) that doesn‘t come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.

Failed to load properties file for project ‘xxx‘

于是我把注意力放到第三方包可能加错的情况中。于是按照网上的说法,将包都重新加了一遍还是报错。

最后发现是debug证书的问题。我到C:\Users\xxx\.android\debug.keystore目录下看到

大家可以看到debug.keystore的日期是 2011-1-11,而今天是2012-1-13日,果然如网上所说,超过了一年,debug证书过期了。

于是我删掉这个文件,重新编译运行,果然没问题了,而此时 该目录又重新生成了debug.keystore,日期是今天。

如果你想重现这个问题,也很简单,必须clear工程,否则它不会再到该目录下装载证书,即使你把这个文件换成2010的也不会不错,而你clear后,

项目会重新装载证书,检测证书的有效期。希望对大家有所帮助。

时间: 2024-08-28 20:22:08

Android编译错误, Ignoring InnerClasses attribute for an anonymous inner class的相关文章

android studio解决warning: Ignoring InnerClasses attribute for an anonymous inner class

在proguard-rules.pro中添加以下代码: -keepattributes EnclosingMetho build.gradle的编译配置如下: apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { applicationId "com.app.aib" minSdkVersion

Android Studio 之 warning: Ignoring InnerClasses attribute for an anonymous inner class

在将Eclipse做的Android项目成功导入Android Studio 后,启动生成,报出错如下图,但是项目可以正常启动运行: 网上大部分给出的解决方案大都是: 在项目工程的配置文件 proguard-rules.pro 中加入下面这句代码即可: -keepattributes EnclosingMethod 但是尝试之后还是不行,发布不了,最后使用这种方式解决了,添加之后可以正常发布 首先修改Gradle配置文件,启用MultiDex并包含MultiDex支持: defaultConfi

android 编译错误 Error:(1, 0) Plugin with id 'com.android.application' not found.

在导入一个项目时,由于它本身的gradle版本比较高,你试用比较旧版本的gradle时就报出Plugin with id 'com.android.application' not found.的错误 如果出现如上错误,只需要在build.gradle中添加下面代码即可: (直接加在 android{ } 的外面) buildscript { repositories { jcenter() // or mavenCentral() } dependencies { classpath 'com

Android 编译错误/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../

编译时出现/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libz.so when searching for -lz错误 ============================================ PLATFORM_VERSION_CODENAME=AOSP PLATFORM_VERSION=AOSP TARGET_PRODUCT=generic TARGET_BUIL

Android编译错误——undefined reference to

[错误描述] 未定义引用 提示如下:bootable/recovery/minzip/Zip.c:1122: error: undefined reference to 'selabel_lookup'bootable/recovery/minzip/Zip.c:1123: error: undefined reference to 'setfscreatecon'bootable/recovery/minzip/Zip.c:1129: error: undefined reference to

排查Android编译错误时的技巧

编译Android时,我们常用命令 make flashfiles -j8 -j8代表用系统的8个线程去编译 但是这样出来的log会直接打印在标准输出里,会存不全:而且因为是8个线程,会导致log的顺序是乱的 所以当我们编译过一次之后(大部分文件已经被编译了,下次编译会跳过,这样节省下大部分时间) 选择下面的命令编译比较好: nohup make flashfiles -j1 log会存储在当前目录下的"nohup"文件中,并且-j1参数指定只用1个线程去编译,log顺序不会乱,这样方便我们排查

Android 编译错误——布局 Error parsing XML: not well-formed (invalid token)

在修改了Android布局文件后,编译出现Error parsing XML: not well-formed (invalid token). 首先先排查xml文件的编码格式是否为UTF-8, <?xml version="1.0" encoding="utf-8"?> ,注意,从别处copy的要留意编码格式! 还有各个标签是否有遗漏,把鼠标箭头移到出错误的layout上 点击鼠标右键选择Source然后再选Format. 都没有问题,结果发现报错处(

Android 编译错误

本人使用的是Android studio1.3版本,前几天调试通过的项目,现在编译出现了错误.错误信息如下 1 Project app: apk dependencies can only be jars. android:mgimlibs:aar:unspecified is an Android Library. 2 Project app: apk dependencies can only be jars. com.android.support:appcompat-v7:aar:19.

【转】ubuntu11.10 64bit 环境android编译错误

原文网址:http://blog.csdn.net/lmhgen/article/details/7326083 错误1: 注意:external/protobuf/java/src/main/java/com/google/protobuf/GeneratedMessageLite.java 使用了未经检查或不安全的操作. 注意:要了解详细信息,请使用 -Xlint:unchecked 重新编译.注意:external/protobuf/java/src/main/java/com/googl